niprov.recording module

niprov.recording.record(command, new=None, parents=None, transient=False, args=None, kwargs=None, user=None, opts=None, dependencies=<niprov.dependencies.Dependencies object>)

Execute a command and log it as provenance for the newly created file.

Parameters:
  • command (list or str or callable) – Command to be executed. Either a string of executable system code, a list of components thereof, or a python function object.
  • new (list or str, optional) – Override path to the new file(s), i.e. if they cannot be parsed from the command.
  • parents (list or str, optional) – Override paths to parent file(s), i.e. if they cannot be parsed from the command.
  • transient (bool, optional) – Set this to True to indicate that the file is only temporary and future checks should not expect it to be physically present. Defaults to False, assuming that the file remains.
  • args (list, optional) – Positional arguments to be passed to command.
  • kwargs (dict, optional) – Keyword arguments to be passed to command.
  • opts (Configuration) – General settings for niprov. See niprov.config
Returns:

New provenance

Return type:

dict