ccsds_ndm.kvn_builder
KVN object builder: mapping a KvnDocument
onto the xsdata dataclass tree for the detected NDM type.
Registry dispatch
The build_object entry point uses the schema registry to decide which
structural variant (flat / segmented / CDM) to use, replacing the old
approach of probing the KvnDocument structure at runtime.
_build_sub_object uses the registry’s per-type handler sentinels to
dispatch to special builders (rotation types, etc.) instead of hard-coding
class names.
Functions
|
Build a dataclass instance directly from KVN |
|
Map a |
|
Returns the list of KVN keyword names recognised by |
|
Instantiate a root NDM class (e.g. |
- build_ndm_object(clazz, local_lines, prefix=None)[source]
Build a dataclass instance directly from KVN
local_lines.- Each entry in
local_linesis a list of 2 or 3 strings: [key, value]- plain field or nested single-value dataclass[key, value, units]- nested dataclass that also carries a units attribute
- Each entry in
- build_object(doc)[source]
Map a
KvnDocumentonto the xsdata dataclass tree for the detected NDM type.Uses the schema registry to determine the document dispatch strategy (flat / segmented / CDM) instead of probing the document structure.
- Parameters:
doc (
KvnDocument) – Output ofdispatch_document().- Returns:
object– Fully populated root xsdata dataclass instance.- Return type: