yggdrasil.pickle.ser.logicals¶
logicals ¶
DecimalSerialized
dataclass
module-attribute
¶
Decimal payload
payload = 3 x signed int64: coefficient precision scale
Notes¶
- coefficient is the signed integer formed from the decimal digits
- precision is the number of digits
- scale is the number of fractional decimal digits
DatetimeSerialized
dataclass
module-attribute
¶
Datetime payload
payload = big-endian int64 epoch integer metadata: u = s|ms|us|ns z = optional timezone text
DateSerialized
dataclass
module-attribute
¶
Date payload
payload = signed int32 days since epoch
TimeSerialized
dataclass
module-attribute
¶
Time payload
payload = unsigned int64 offset from midnight metadata: u = s|ms|us|ns z = optional timezone text
TimedeltaSerialized
dataclass
module-attribute
¶
Timedelta payload
payload = signed int64 duration metadata: u = s|ms|us|ns
TimezoneSerialized
dataclass
module-attribute
¶
Timezone payload
payload = utf-8 timezone text metadata: k = tz
UUIDSerialized
dataclass
module-attribute
¶
UUID payload
payload = 16 raw bytes
ComplexNumberSerialized
dataclass
module-attribute
¶
Complex payload
payload = float64(real) + float64(imag)
BytesSerialized
dataclass
module-attribute
¶
Enhanced bytes payload: also handles bytearray and memoryview.
payload = raw bytes
metadata:
k = b | ba | mv
PathSerialized
dataclass
module-attribute
¶
Path payload modes:
- path mode
- metadata: pm = p po = source os family
- payload: utf-8 string path
-
decode: rebuild path for current OS semantics
-
file mode
- metadata: pm = f fn = original filename po = source os family
- payload: raw file bytes
-
decode: write to a temp file and return that path
-
inline zipped directory mode
- metadata: pm = dz dn = original directory name po = source os family
- payload: zip bytes
- decode: extract to temp dir and return that path
Directory embedding is only used when total file bytes are below MAX_INLINE_DIR_BYTES.
IPAddressSerialized
dataclass
module-attribute
¶
IP payload
payload = canonical utf-8 string metadata: k = 4a | 6a | 4i | 6i | 4n | 6n
URLSerialized
dataclass
module-attribute
¶
URL payload
payload = utf-8 URL string
LogicalSerialized
dataclass
¶
Bases: Serialized[T], Generic[T]
Base class for compact logical / semantic Python payloads.
Strategy: - use compact, fixed-width payload bytes whenever possible - use short metadata keys - keep decoding logic explicit and boring
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.