yggdrasil.pickle.ser¶
ser ¶
HeaderDecodeError ¶
Bases: SerializationError
Raised when a header cannot be parsed from the buffer.
InvalidCodecError ¶
Bases: SerializationError
Raised when an unknown codec id is encountered.
MetadataDecodeError ¶
Bases: SerializationError
Raised when encoded metadata is malformed.
SerializationError ¶
Bases: RuntimeError
Base exception for yggdrasil.pickle.ser.
Serialized
dataclass
¶
Bases: ABC, Generic[T]
module_and_name
staticmethod
¶
Return (module, qualname) for obj.
Robust across Python objects, including many C-extension / PyArrow objects where module may be missing or misleading.
dump ¶
dump(
obj: Any,
fp: IO[bytes] | Path | str,
*,
metadata: Mapping[bytes, bytes] | None = None,
codec: int | None = None
) -> None
Serialise obj and write it to fp (file-like, :class:~pathlib.Path, or str path).
dumps ¶
dumps(
obj: Any,
*,
metadata: Mapping[bytes, bytes] | None = None,
codec: int | None = None,
b64: bool = False
) -> bytes | str
Serialise obj to bytes, or to a URL-safe base-64 str when b64 is True.
load ¶
load(
fp: IO[bytes] | Path | str,
*,
unpickle: bool = True,
clean_corrupted: bool = False,
default: Any = None
) -> Any
Read a serialised payload from fp and optionally unpickle it.
loads ¶
Deserialise from s (bytes or URL-safe base-64 str).
serialize ¶
serialize(
obj: Any,
*,
metadata: Mapping[bytes, bytes] | None = None,
codec: int | None = None
) -> Serialized
Wrap obj in a :class:Serialized instance without writing to a buffer.