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_ndm_object(clazz, local_lines[, prefix])

Build a dataclass instance directly from KVN local_lines.

build_object(doc)

Map a KvnDocument onto the xsdata dataclass tree for the detected NDM type.

get_ccsds_kw_list(clazz)

Returns the list of KVN keyword names recognised by clazz.

init_root_ndm_object(clazz)

Instantiate a root NDM class (e.g. Apm, Oem) with None placeholders.

build_ndm_object(clazz, local_lines, prefix=None)[source]

Build a dataclass instance directly from KVN local_lines.

Each entry in local_lines is 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

build_object(doc)[source]

Map a KvnDocument onto 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 of dispatch_document().

Returns:

object – Fully populated root xsdata dataclass instance.

Return type:

object

get_ccsds_kw_list(clazz)[source]

Returns the list of KVN keyword names recognised by clazz.

Handles dataclasses (field metadata "name"), Enum types (member names), and edge classes (returns []).

init_root_ndm_object(clazz)[source]

Instantiate a root NDM class (e.g. Apm, Oem) with None placeholders.