safe.metadata.provenance.provenance module

InaSAFE Disaster risk assessment tool developed by AusAid - metadata module.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.metadata.provenance.provenance.Provenance[source]

Bases: object

Class to store a list of provenance steps.

New in version 3.2.

append_step(title, description, timestamp=None)[source]

Append a new provenance step.

Parameters:
  • title (str) – the title of the ProvenanceStep
  • description (str) – the description of the ProvenanceStep
  • timestamp (datetime) – the time of the ProvenanceStep
Returns:

the time of the ProvenanceStep

Return type:

datetime

count[source]

the size of the list.

Returns:the size
Return type:int
dict[source]

the python object for rendering json.

It is called dict to be coherent with the other modules but it actually returns a list

Returns:the python object for rendering json
Return type:list
get(index)[source]

the step at index position of the list.

Returns:the step at index
Return type:ProvenanceStep
last[source]

the last step of the list.

Returns:the last step
Return type:ProvenanceStep
steps[source]

the steps list.

Returns:the steps list
Return type:list
xml[source]

the xml string representation.

Returns:the xml string
Return type:str