Project specs#
- Pydantic model esgvoc.api.project_specs.DrsCollection[source]#
Bases:
BaseModel
A collection part of a DRS specification (e.g., institution_id for CMIP6).
Show JSON schema
{ "title": "DrsCollection", "description": "A collection part of a DRS specification (e.g., institution_id for CMIP6).", "type": "object", "properties": { "collection_id": { "title": "Collection Id", "type": "string" }, "is_required": { "title": "Is Required", "type": "boolean" }, "kind": { "const": "collection", "default": "collection", "title": "Kind", "type": "string" } }, "required": [ "collection_id", "is_required" ] }
- Pydantic model esgvoc.api.project_specs.DrsConstant[source]#
Bases:
BaseModel
A constant part of a DRS specification (e.g., cmip5).
Show JSON schema
{ "title": "DrsConstant", "description": "A constant part of a DRS specification (e.g., cmip5).", "type": "object", "properties": { "value": { "title": "Value", "type": "string" }, "kind": { "const": "constant", "default": "constant", "title": "Kind", "type": "string" } }, "required": [ "value" ] }
- class esgvoc.api.project_specs.DrsPartKind(*values)[source]#
-
The kinds of DRS part (constant and collection).
- Pydantic model esgvoc.api.project_specs.DrsSpecification[source]#
Bases:
BaseModel
A DRS specification.
Show JSON schema
{ "title": "DrsSpecification", "description": "A DRS specification.", "type": "object", "properties": { "type": { "$ref": "#/$defs/DrsType" }, "separator": { "title": "Separator", "type": "string" }, "properties": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Properties" }, "parts": { "items": { "discriminator": { "mapping": { "collection": "#/$defs/DrsCollection", "constant": "#/$defs/DrsConstant" }, "propertyName": "kind" }, "oneOf": [ { "$ref": "#/$defs/DrsConstant" }, { "$ref": "#/$defs/DrsCollection" } ] }, "title": "Parts", "type": "array" } }, "$defs": { "DrsCollection": { "description": "A collection part of a DRS specification (e.g., institution_id for CMIP6).", "properties": { "collection_id": { "title": "Collection Id", "type": "string" }, "is_required": { "title": "Is Required", "type": "boolean" }, "kind": { "const": "collection", "default": "collection", "title": "Kind", "type": "string" } }, "required": [ "collection_id", "is_required" ], "title": "DrsCollection", "type": "object" }, "DrsConstant": { "description": "A constant part of a DRS specification (e.g., cmip5).", "properties": { "value": { "title": "Value", "type": "string" }, "kind": { "const": "constant", "default": "constant", "title": "Kind", "type": "string" } }, "required": [ "value" ], "title": "DrsConstant", "type": "object" }, "DrsType": { "description": "The types of DRS specification (directory, file name and dataset id).", "enum": [ "directory", "file_name", "dataset_id" ], "title": "DrsType", "type": "string" } }, "required": [ "type", "separator", "parts" ] }
- field parts: list[Annotated[DrsConstant | DrsCollection, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] [Required][source]#
The parts of the DRS specification.
- class esgvoc.api.project_specs.DrsType(*values)[source]#
-
The types of DRS specification (directory, file name and dataset id).
- Pydantic model esgvoc.api.project_specs.GlobalAttributeSpecBase[source]#
Bases:
BaseModel
Specification for a global attribute.
Show JSON schema
{ "title": "GlobalAttributeSpecBase", "description": "Specification for a global attribute.", "type": "object", "properties": { "source_collection": { "title": "Source Collection", "type": "string" }, "value_type": { "$ref": "#/$defs/GlobalAttributeValueType" } }, "$defs": { "GlobalAttributeValueType": { "description": "The types of global attribute values.", "enum": [ "string", "integer", "float" ], "title": "GlobalAttributeValueType", "type": "string" } }, "required": [ "source_collection", "value_type" ] }
- field value_type: GlobalAttributeValueType [Required][source]#
The expected value type.
- accept(attribute_name: str, visitor: GlobalAttributeVisitor) Any [source]#
- Pydantic model esgvoc.api.project_specs.GlobalAttributeSpecSpecific[source]#
Bases:
GlobalAttributeSpecBase
Specification for a global attribute. with a specific key
Show JSON schema
{ "title": "GlobalAttributeSpecSpecific", "description": "Specification for a global attribute.\nwith a specific key", "type": "object", "properties": { "source_collection": { "title": "Source Collection", "type": "string" }, "value_type": { "$ref": "#/$defs/GlobalAttributeValueType" }, "specific_key": { "title": "Specific Key", "type": "string" } }, "$defs": { "GlobalAttributeValueType": { "description": "The types of global attribute values.", "enum": [ "string", "integer", "float" ], "title": "GlobalAttributeValueType", "type": "string" } }, "required": [ "source_collection", "value_type", "specific_key" ] }
- field specific_key: str [Required][source]#
If the validation is for the value of a specific key, for instance description or ui-label
- accept(attribute_name: str, visitor: GlobalAttributeVisitor) Any [source]#
Accept a global attribute visitor.
- Parameters:
attribute_name – The attribute name.
visitor (GlobalAttributeVisitor) – The global attribute visitor.
- Returns:
Depending on the visitor.
- Return type:
Any
- Pydantic model esgvoc.api.project_specs.GlobalAttributeSpecs[source]#
Bases:
BaseModel
Container for global attribute specifications.
Show JSON schema
{ "title": "GlobalAttributeSpecs", "description": "Container for global attribute specifications.", "type": "object", "properties": { "specs": { "additionalProperties": { "anyOf": [ { "$ref": "#/$defs/GlobalAttributeSpecSpecific" }, { "$ref": "#/$defs/GlobalAttributeSpecBase" } ] }, "title": "Specs", "type": "object" } }, "$defs": { "GlobalAttributeSpecBase": { "description": "Specification for a global attribute.", "properties": { "source_collection": { "title": "Source Collection", "type": "string" }, "value_type": { "$ref": "#/$defs/GlobalAttributeValueType" } }, "required": [ "source_collection", "value_type" ], "title": "GlobalAttributeSpecBase", "type": "object" }, "GlobalAttributeSpecSpecific": { "description": "Specification for a global attribute.\nwith a specific key", "properties": { "source_collection": { "title": "Source Collection", "type": "string" }, "value_type": { "$ref": "#/$defs/GlobalAttributeValueType" }, "specific_key": { "title": "Specific Key", "type": "string" } }, "required": [ "source_collection", "value_type", "specific_key" ], "title": "GlobalAttributeSpecSpecific", "type": "object" }, "GlobalAttributeValueType": { "description": "The types of global attribute values.", "enum": [ "string", "integer", "float" ], "title": "GlobalAttributeValueType", "type": "string" } } }
- field specs: dict[str, GlobalAttributeSpecSpecific | GlobalAttributeSpecBase] [Optional][source]#
The global attributes specifications dictionary.
- class esgvoc.api.project_specs.GlobalAttributeValueType(*values)[source]#
-
The types of global attribute values.
- class esgvoc.api.project_specs.GlobalAttributeVisitor(*args, **kwargs)[source]#
Bases:
Protocol
Specifications for a global attribute visitor.
- visit_base_attribute(attribute_name: str, attribute: GlobalAttributeSpecBase) Any [source]#
Visit a base global attribute.
- visit_specific_attribute(attribute_name: str, attribute: GlobalAttributeSpecSpecific) Any [source]#
Visit a specific global attribute.
- Pydantic model esgvoc.api.project_specs.ProjectSpecs[source]#
Bases:
BaseModel
A project specifications.
Show JSON schema
{ "title": "ProjectSpecs", "description": "A project specifications.", "type": "object", "properties": { "project_id": { "title": "Project Id", "type": "string" }, "description": { "title": "Description", "type": "string" }, "drs_specs": { "items": { "$ref": "#/$defs/DrsSpecification" }, "title": "Drs Specs", "type": "array" }, "global_attributes_specs": { "anyOf": [ { "$ref": "#/$defs/GlobalAttributeSpecs" }, { "type": "null" } ], "default": null } }, "$defs": { "DrsCollection": { "description": "A collection part of a DRS specification (e.g., institution_id for CMIP6).", "properties": { "collection_id": { "title": "Collection Id", "type": "string" }, "is_required": { "title": "Is Required", "type": "boolean" }, "kind": { "const": "collection", "default": "collection", "title": "Kind", "type": "string" } }, "required": [ "collection_id", "is_required" ], "title": "DrsCollection", "type": "object" }, "DrsConstant": { "description": "A constant part of a DRS specification (e.g., cmip5).", "properties": { "value": { "title": "Value", "type": "string" }, "kind": { "const": "constant", "default": "constant", "title": "Kind", "type": "string" } }, "required": [ "value" ], "title": "DrsConstant", "type": "object" }, "DrsSpecification": { "description": "A DRS specification.", "properties": { "type": { "$ref": "#/$defs/DrsType" }, "separator": { "title": "Separator", "type": "string" }, "properties": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Properties" }, "parts": { "items": { "discriminator": { "mapping": { "collection": "#/$defs/DrsCollection", "constant": "#/$defs/DrsConstant" }, "propertyName": "kind" }, "oneOf": [ { "$ref": "#/$defs/DrsConstant" }, { "$ref": "#/$defs/DrsCollection" } ] }, "title": "Parts", "type": "array" } }, "required": [ "type", "separator", "parts" ], "title": "DrsSpecification", "type": "object" }, "DrsType": { "description": "The types of DRS specification (directory, file name and dataset id).", "enum": [ "directory", "file_name", "dataset_id" ], "title": "DrsType", "type": "string" }, "GlobalAttributeSpecBase": { "description": "Specification for a global attribute.", "properties": { "source_collection": { "title": "Source Collection", "type": "string" }, "value_type": { "$ref": "#/$defs/GlobalAttributeValueType" } }, "required": [ "source_collection", "value_type" ], "title": "GlobalAttributeSpecBase", "type": "object" }, "GlobalAttributeSpecSpecific": { "description": "Specification for a global attribute.\nwith a specific key", "properties": { "source_collection": { "title": "Source Collection", "type": "string" }, "value_type": { "$ref": "#/$defs/GlobalAttributeValueType" }, "specific_key": { "title": "Specific Key", "type": "string" } }, "required": [ "source_collection", "value_type", "specific_key" ], "title": "GlobalAttributeSpecSpecific", "type": "object" }, "GlobalAttributeSpecs": { "description": "Container for global attribute specifications.", "properties": { "specs": { "additionalProperties": { "anyOf": [ { "$ref": "#/$defs/GlobalAttributeSpecSpecific" }, { "$ref": "#/$defs/GlobalAttributeSpecBase" } ] }, "title": "Specs", "type": "object" } }, "title": "GlobalAttributeSpecs", "type": "object" }, "GlobalAttributeValueType": { "description": "The types of global attribute values.", "enum": [ "string", "integer", "float" ], "title": "GlobalAttributeValueType", "type": "string" } }, "additionalProperties": true, "required": [ "project_id", "description", "drs_specs" ] }
- field drs_specs: list[DrsSpecification] [Required][source]#
The DRS specifications of the project (directory, file name and dataset id).
- field global_attributes_specs: GlobalAttributeSpecs | None = None[source]#
The global attributes specifications of the project.
- esgvoc.api.project_specs.DrsPart[source]#
A fragment of a DRS specification
alias of
Annotated
[DrsConstant
|DrsCollection
, FieldInfo(annotation=NoneType, required=True, discriminator=’kind’)]