6. Exporters: argonodes.exporters
Exporters are useful to export Models in multiple formats.
In some cases, it may be necessary to export in formats that do not correspond to the basic Argonodes format (e.g., CSV, SQL, …). It is therefore possible to build custom exporters that meet these needs.
Basic usage: exporter = Exporter(); model.export(exporter)
- class argonodes.exporters.CSVExporter(file_or_buf=None)
Bases:
Exporter
Exporter to a CSV.
- Parameters
file_or_buf (str or io.StringIO, default None.) – File or buffer where to export. If None, it will print the CSV instead.
- EXT = '.csv'
- class argonodes.exporters.Exporter(file_or_buf=None)
Bases:
ABC
Abstraction for every Exporter
- EXT = ''
- class argonodes.exporters.JSONExporter(file_or_buf=None)
Bases:
Exporter
Exporter to JSON.
- Parameters
file_or_buf (str or io.StringIO, default None.) – File or buffer where to export. If None, it will print the JSON instead.
- EXT = '.json'
- class argonodes.exporters.JSONLDExporter(file_or_buf=None)
Bases:
JSONExporter
Exporter to JSON-LD.
- Parameters
file_or_buf (str or io.StringIO, default None.) – File or buffer where to export. If None, it will print the JSON-LD instead.
- EXT = '.jsonld'
- MODEL_CONTEXT = {'description': 'https://schema.org/description', 'fileFormat': 'https://schema.org/fileFormat', 'fileName': 'https://schema.org/name', 'filePath': 'https://www.wikidata.org/wiki/Q817765'}