mt_metadata.transfer_functions.io.emtfxml.metadata.provenance
Classes
Base class for all metadata objects with Pydantic validation. |
Module Contents
- class mt_metadata.transfer_functions.io.emtfxml.metadata.provenance.Provenance(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- create_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']})]
- creating_application: Annotated[str, Field(default='mt_metadata', description='name of the application that created the XML file', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['EMTF File Conversion Utilities 4.0']})]
- creator: Annotated[mt_metadata.common.Person, Field(default_factory=Person, description='Person or group responsible for creating the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Person(name='John Doe', email='john.doe@example.com')"]})]
- submitter: Annotated[mt_metadata.common.Person, Field(default_factory=Person, description='Person or group responsible for submitting the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Person(name='Jane Smith', email='jane.smith@example.com')"]})]
- classmethod validate_create_time(field_value)
- read_dict(input_dict)
Read the Provenance object from a dictionary.
- Parameters:
input_dict (dict) – The input dictionary containing the Provenance data.
- to_xml(string=False, required=True)
Convert the Provenance object to XML format.
- Parameters:
string (bool, optional) – Whether to return the XML as a string, by default False
required (bool, optional) – Whether all required fields must be present, by default True
- Returns:
The XML representation of the Provenance object
- Return type:
str | et.Element