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.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" } }, "$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" } }, "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.
- esgvoc.api.project_specs.DrsPart[source]#
A fragment of a DRS specification
alias of
Annotated
[DrsConstant
|DrsCollection
, FieldInfo(annotation=NoneType, required=True, discriminator=’kind’)]