Expand description
Python wrappers for the standalone spvirit-codec encoder/decoder.
Exposes introspection types (FieldDesc, StructureDesc), packet-level
decoding of pvData buffers, and encoding helpers usable without any
network IO.
Structs§
- PyField
Desc - A single field description: name and a type string (e.g. “int32”, “double[]”, “struct”, “struct[]”, “union”, “any”, “string[5]”).
- PyStructure
Desc - Structure type description: optional struct ID plus ordered fields.
Functions§
- decode_
introspection - Decode a
StructureDescfrom raw introspection bytes (the PVD field description as seen on the wire). - decode_
packet - Best-effort inspection of a full PVA packet (header + payload).
Returns a dict with
command,command_name,version,flags, and adetailssub-dict describing the command-specific payload. - decode_
value - Decode a pvData value given the accompanying
StructureDesc. - encode_
put_ payload - Encode a PUT payload (size-prefixed bitset + field data) for the given
structure description and value dict. The bitset is built from the
field keys present in
valueso callers only transmit changed fields. - encode_
pv_ request - Encode a pvRequest mask selecting specific top-level fields. Pass an empty list or None to request all fields.
- extract_
nt_ value - Extract the inner
valuefield from an NT structure dict. Returns None if the input is not an NT structure. - format_
value - Compact single-line representation of a decoded value. Accepts any
Python object that was produced by
decode_valueor by this crate’s GET result conversion; non-NT inputs are round-tripped via their string form. - register
- Register the
spvirit.codecsubmodule.