+"""
+This module contains the different Trace apis.
+
+Note that there are a couple of different traces:
+ * The ExtractionTrace and MetaExtractionTrace, which are offered to the process function.
+ * ExtractionTraceBuilder, which is a trace that can be built; it does not exist in hansken yet, but it is added after
+ building.
+ * SearchTrace, which represents an immutable trace which is returned after searching for traces.
+"""
+from abc import ABC, abstractmethod
+from io import BufferedReader, BufferedWriter
+from typing import Any, Literal, Mapping, Optional, Union
+
+from hansken_extraction_plugin.api.tracelet import Tracelet
+from hansken_extraction_plugin.api.transformation import Transformation
+
+
+
+
+
+[docs]class Trace(ABC):
+
"""All trace classes should be able to return values."""
+
+
[docs] @abstractmethod
+
def get(self, key: str, default: Any = None) -> Any:
+
"""
+
Return metadata properties for this `.ExtractionTrace`.
+
+
:param key: the metadata property to be retrieved
+
:param default: value returned if property is not set
+
:return: the value of the requested metadata property
+
"""
+
+
+[docs]class SearchTrace(Trace):
+
"""SearchTraces represent traces returned when searching for traces."""
+
+
[docs] @abstractmethod
+
def open(self, stream: str = 'raw', offset: int = 0, size: int = None) -> BufferedReader:
+
"""
+
Open a data stream of the data that is being processed.
+
+
:param stream: data stream of trace to open. defaults to raw. other examples are html, text, etc.
+
:param offset: byte offset to start the stream on
+
:param size: the number of bytes to make available
+
:return: a file-like object to read bytes from the named stream
+
"""
+
+
+
+
+
+
+