ccsds_ndm.kvn_writer

KVN writer: serialise an xsdata dataclass tree to a list of KvnLine objects.

This is the inverse of ccsds_ndm.kvn_builder. The public entry point is write_kvn_lines().

Uses the schema registry to dispatch document structure (flat / segmented / CDM) and per-type special writers (packed state, packed attitude, covariance, TDM observation, rotation types).

Functions

write_kvn_lines(ndm_obj)

Convert an xsdata NDM object tree to an ordered list of KvnLine instances ready for rendering.

write_kvn_lines(ndm_obj)[source]

Convert an xsdata NDM object tree to an ordered list of KvnLine instances ready for rendering.

Parameters:

ndm_obj (object) – Root xsdata dataclass instance (e.g. Opm, Oem, …).

Returns:

list[KvnLine] – KVN lines. Call line.to_str() on each and join with "\n" to produce the final KVN text.

Return type:

list[KvnLine]