Skip to content

dew.data.sources.codec

The ArrayRecord byte-map layout and the artifact record codec.

NameSummary
Value
UnencodableA value the artifact codec has no encoding for, as a record a cache keeps meets it.
pack_dict_of_byte_arrays
unpack_dict_of_byte_arrays
encode
decode
content_fingerprintSHA256 of content with every mapping ordered by key.
fingerprint
encoded_fingerprintfingerprint of the values encoded holds, each as encode wrote it, for a caller that holds their encodings already.

attribute source

class source

class Unencodable(TypeError)

A value the artifact codec has no encoding for, as a record a cache keeps meets it.

function source

def pack_dict_of_byte_arrays(values: Mapping[str, bytes]) -> bytes

function source

def unpack_dict_of_byte_arrays(payload: bytes) -> dict[str, bytes]

function source

def encode(value: Value, *, canonical: bool = False) -> bytes

function source

def decode(value: bytes) -> Value

function source

def content_fingerprint(value: Value, *, opaque: bool = False) -> bytes

SHA256 of content with every mapping ordered by key. opaque reads any object, a mapping’s keys of any type and an array in any storage order, hashing each leaf as it is read (_Hashed), for a digest that guards a stream rather than an artifact anyone decodes (dew.data.dataset.Replayed).

function source

def fingerprint(values: Iterable[Value]) -> str

function source

def encoded_fingerprint(encoded: Iterable[bytes]) -> str

fingerprint of the values encoded holds, each as encode wrote it, for a caller that holds their encodings already.