Exporting Config¶
- class omnifig.exporting.ConfigExporter¶
Bases:
SimpleExporterBase
Exporter for config objects, can load and save config objects in four formats: json, yaml, toml, and the native “.fig.yml” format (which is equivalent to yaml).
- export_payload(src, payload, path, *, fmt=None, **kwargs)¶
Exports the given payload to the given path.
- Parameters:
src (
AbstractExportManager
) – manager used for delegating the export to a different formatpayload (
ConfigNode
) – config object to be exportedpath (
Path
) – destination path for the exportfmt (
Optional
[str
]) – format to use for the export (if None, will be inferred from the path, defaults to .fig.yml)
- Return type:
Path
- Returns:
the path to the exported file (or None if the export failed)