mt_metadata.transfer_functions.io.emtfxml.metadata.copyright
Classes
Base class for all metadata objects with Pydantic validation. |
Module Contents
- class mt_metadata.transfer_functions.io.emtfxml.metadata.copyright.Copyright(**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
- citation: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.Citation, Field(default_factory=Citation, description='The citation information for the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Citation(authors='Doe, J.', year='2023', title='Title of the paper', journal='Journal Name', volume='45', pages='123-145')"]})]
- selected_publications: Annotated[str | None, Field(default=None, description='Any publications that use this data', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['my paper']})]
- release_status: Annotated[mt_metadata.common.enumerations.ReleaseStatusEnum, Field(default='Unrestricted Release', description='the release status of the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Unrestricted release']})]
- conditions_of_use: Annotated[str, Field(default='All data and metadata for this survey are available free of charge and may be copied freely, duplicated and further distributed provided this data set is cited as the reference. While the author(s) strive to provide data and metadata of best possible quality, neither the author(s) of this data set, not IRIS make any claims, promises, or guarantees about the accuracy, completeness, or adequacy of this information, and expressly disclaim liability for errors and omissions in the contents of this file. Guidelines about the quality or limitations of the data and metadata, as obtained from the author(s), are included for informational purposes only.', description='Any notes on conditions of use', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Cite data upon usage.']})]
- acknowledgement: Annotated[str | None, Field(default=None, description='any acknowledgments the transfer function should have.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['This project was funded by x.']})]
- additional_info: Annotated[str | None, Field(default=None, description='any additional information about the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['This purpose of this project is ...']})]
- read_dict(input_dict)
- Parameters:
input_dict (TYPE) – DESCRIPTION
- Returns:
DESCRIPTION
- Return type:
TYPE
- to_xml(string=False, required=True)
Convert metadata to an XML representation.
Creates an XML element with type and unit information for each attribute.
- Parameters:
string (bool, optional) – If True, return XML as a string. If False, return an XML Element. Default is False.
required (bool, optional) – If True, include only required elements and elements with non-None values. If False, include all elements. Default is True.
- Returns:
XML Element object if string=False, otherwise XML string
- Return type:
str | et.Element
Examples
>>> xml_elem = metadata.to_xml() >>> xml_str = metadata.to_xml(string=True)