niprov.exporting module

niprov.exporting.backup(dependencies=<niprov.dependencies.Dependencies object>)

Shortcut for export(medium=’file’, form=’json’) for all provenance.

niprov.exporting.export(provenance, medium, form, pipeline=False, dependencies=<niprov.dependencies.Dependencies object>)

Publish or simply return provenance for selected files.

To get provenance on one specific file, pass its path as the ‘forFile’ argument. Alternatively, to get all files associated with a certain subject, use the ‘forSubject’ argument. If none of these is used, provenance for the most recently registered files is reported.

Parameters:
  • provenance – Niprov BaseFile object or list of such.
  • medium (str) –

    The medium in which to publish the provenance. One of:

    ‘stdout’ (print the provenance to the terminal), ‘direct’ (return object to caller), ‘file’ (write to a text file), ‘viewer’ (open in the system image viewer).
  • form (str) – The format in which to serialize the provenance. One of ‘json’,’xml’,’narrated’,’simple’,’dict’,’picture’.
Returns:

Depends on medium selected.

niprov.exporting.print_(provenance, pipeline=False, dependencies=<niprov.dependencies.Dependencies object>)

Shortcut for export(medium=’stdout’, form=’simple’).

niprov.exporting.view(provenance, pipeline=False, dependencies=<niprov.dependencies.Dependencies object>)

Shortcut for export(medium=’viewer’, form=’picture’).