mt_metadata.common.provenance

Classes

Provenance

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.common.provenance.Provenance(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

creation_time: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default_factory=lambda: MTime(time_stamp=None), description='Date and time the file was created.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': '2020-02-08T12:23:40.324600+00:00', 'type': 'string'})]
comments: Annotated[mt_metadata.common.Comment, Field(default_factory=Comment, description='Any comments on provenance of the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'all good', 'type': 'string'})]
log: Annotated[str | None, Field(default=None, description='A history of changes made to the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '2020-02-10T14:24:45+00:00 updated metadata', 'type': 'string'})]
creator: Annotated[mt_metadata.common.AuthorPerson, Field(default_factory=AuthorPerson, description='Person who created the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Person(name=J. Pedantic, email=jped@mt.com)'})]
submitter: Annotated[mt_metadata.common.AuthorPerson, Field(default_factory=AuthorPerson, description='Person who submitted the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Person(name=submitter_name, email=submitter@email)'})]
archive: Annotated[mt_metadata.common.Person, Field(default_factory=Person, description='Archive from which the data was downloaded from.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Person(name=archive_name, url=https://archive.url)'})]
software: Annotated[mt_metadata.common.Software, Field(default_factory=Software, description='Software used to create the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Software(name=mt_metadata, version=0.1)'})]
classmethod validate_creation_time(field_value)
classmethod validate_comments(value, info)

Validate that the value is a valid comment.