pymetkit.models =============== .. py:module:: pymetkit.models .. autoapi-nested-parse:: Pydantic models for pymetkit parameter metadata. Classes ------- .. autoapisummary:: pymetkit.models.MarsRequestContext pymetkit.models.ParameterEntry Module Contents --------------- .. py:class:: MarsRequestContext Bases: :py:obj:`pydantic.BaseModel` A MARS-key context that (partly) selects a parameter id. This mirrors a single matcher rule from ``share/metkit/params.yaml``. Its schema is kept **separate** from :class:`ParameterEntry` so the context contract can evolve independently and so user-supplied context schemas can validate against it. All fields are optional because ``params.yaml`` rules do not always constrain every key (e.g. ``levtype`` is occasionally absent). .. py:attribute:: model_config .. py:attribute:: class_ :type: str | None .. py:attribute:: stream :type: str | None .. py:attribute:: type :type: str | None .. py:attribute:: levtype :type: str | None .. py:class:: ParameterEntry Bases: :py:obj:`pydantic.BaseModel` A single entry from the ECMWF parameter database. Accepts both the canonical field names produced by ``_normalise`` and the raw aliases that may appear in YAML or API responses. .. py:attribute:: model_config .. py:attribute:: id :type: int .. py:attribute:: shortname :type: str .. py:attribute:: longname :type: str .. py:attribute:: units :type: str .. py:attribute:: table :type: int | None .. py:attribute:: mars_request_context :type: list[MarsRequestContext] .. py:attribute:: origin_ids :type: list[int] .. py:attribute:: access_ids :type: list[str] .. py:method:: coerce_id_to_int(v: Any) -> int :classmethod: .. py:method:: normalise_shortname_key(v: Any) -> str :classmethod: .. py:method:: normalise_longname_key(v: Any) -> str :classmethod: .. py:method:: default_empty_units(v: Any) -> str :classmethod: .. py:method:: coerce_table(v: Any) -> int | None :classmethod: .. py:method:: coerce_origin_ids(v: Any) -> list[int] :classmethod: .. py:method:: coerce_access_ids(v: Any) -> list[str] :classmethod: .. py:method:: _normalise_aliases(data: Any) -> Any :classmethod: Accept legacy key spellings from raw YAML / API payloads.