Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
tdw-catalog / tdw_catalog / metadata / point_in_time.py
Size: Mime:
from datetime import datetime
from typing import Optional

from tdw_catalog.utils import MetadataFieldType
import tdw_catalog.metadata.field as field


class Field(field.MetadataField[datetime]):
    """
    A specific time and date associated with the :class:`.Dataset`

    Attributes
    ----------
    None
    """

    def __init__(self, key: str, value: Optional[datetime]) -> None:
        super().__init__(key, value)

    def serialize(self) -> dict:
        res = super().serialize()
        res["value"] = self.value.isoformat()
        res["field_type"] = MetadataFieldType.FT_DATETIME
        return res