mt_metadata.common.person

Classes

GenericPerson

Base class for all metadata objects with Pydantic validation.

Person

Base class for all metadata objects with Pydantic validation.

AuthorPerson

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.common.person.GenericPerson(**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

organization: Annotated[str | None, Field(default=None, description='Organization full name', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['mt gurus']})]
email: Annotated[pydantic.EmailStr | pydantic.AnyUrl | None, Field(default=None, description='Email of the contact person', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['mt.guru@em.org']})]
url: Annotated[pydantic.AnyUrl | None | str, Field(default=None, description='URL of the contact person', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['https://em.org']})]
comments: Annotated[mt_metadata.common.Comment, Field(default_factory=Comment, description='Any comments about the person', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['expert digger']})]
classmethod validate_comments(value, info)

Validate that the value is a valid comment.

classmethod validate_url(value, info)

Validate that the value is a valid URL.

class mt_metadata.common.person.Person(**data)

Bases: GenericPerson

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

name: Annotated[str | None, Field(default='', description='Persons name, should be full first and last name.', validation_alias=AliasChoices('name', 'author'), json_schema_extra={'units': None, 'required': True, 'examples': ['person name']})]
class mt_metadata.common.person.AuthorPerson(**data)

Bases: GenericPerson

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

author: Annotated[str | None, Field(default='', description='Persons name, should be full first and last name.', validation_alias=AliasChoices('author', 'name'), json_schema_extra={'units': None, 'required': True, 'examples': ['person name']})]