sigmf.sigmffile.SigMFMetafile

class sigmf.sigmffile.SigMFMetafile

Bases: object

Methods

dump

Write metadata to a file.

dumps

Get a string representation of the metadata.

ordered_metadata

Get a nicer representation of _metadata.

Attributes

VALID_KEYS

dump(filep, pretty=True)

Write metadata to a file.

Parameters:
  • filep (object) – File pointer or something that json.dump() can handle.

  • pretty (bool, default True) – When True will write more human-readable output, otherwise will be flat JSON.

dumps(pretty=True)

Get a string representation of the metadata.

Parameters:

pretty (bool, default True) – When True will write more human-readable output, otherwise will be flat JSON.

Returns:

String representation of the metadata using json formatter.

Return type:

string

ordered_metadata()

Get a nicer representation of _metadata. Will sort keys, but put the top-level fields ‘global’, ‘captures’, ‘annotations’ in front.

Returns:

ordered_meta – Cleaner representation of _metadata with top-level keys correctly ordered and the rest of the keys sorted.

Return type:

OrderedDict