sbp.utils module

Shared utility functions.

sbp.utils.containerize(coll)[source]

Walk attribute fields passed from an SBP message and convert to Containers where appropriate. Needed for Construct proper serialization.

coll : dict

sbp.utils.exclude_fields(obj, exclude=['sender', 'msg_type', 'crc', 'length', 'preamble', 'payload'])[source]

Return dict of object without parent attrs.

sbp.utils.fmt_repr(obj)[source]

Print a orphaned string representation of an object without the clutter of its parent object.

sbp.utils.walk_json_dict(coll)[source]

Flatten a parsed SBP object into a dicts and lists, which are compatible for JSON output.

coll : dict