Project specs#

Pydantic model esgvoc.api.project_specs.CatalogExtension[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "CatalogExtension",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "version": {
         "title": "Version",
         "type": "string"
      }
   },
   "required": [
      "name",
      "version"
   ]
}

field name: str [Required][source]#

The name of the extension

field version: str [Required][source]#

The version of the extension

Pydantic model esgvoc.api.project_specs.CatalogProperties[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "CatalogProperties",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "url_template": {
         "title": "Url Template",
         "type": "string"
      },
      "extensions": {
         "items": {
            "$ref": "#/$defs/CatalogExtension"
         },
         "title": "Extensions",
         "type": "array"
      }
   },
   "$defs": {
      "CatalogExtension": {
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         },
         "required": [
            "name",
            "version"
         ],
         "title": "CatalogExtension",
         "type": "object"
      }
   },
   "required": [
      "name",
      "url_template",
      "extensions"
   ]
}

field extensions: list[CatalogExtension] [Required][source]#

The extensions of the catalog.

field name: str [Required][source]#

The name of the catalog system.

field url_template: str [Required][source]#

The URI template of the catalog system.

Pydantic model esgvoc.api.project_specs.CatalogProperty[source]#

Bases: BaseModel

A dataset property described in a catalog.

Show JSON schema
{
   "title": "CatalogProperty",
   "description": "A dataset property described in a catalog.",
   "type": "object",
   "properties": {
      "source_collection": {
         "title": "Source Collection",
         "type": "string"
      },
      "catalog_field_value_type": {
         "title": "Catalog Field Value Type",
         "type": "string"
      },
      "is_required": {
         "title": "Is Required",
         "type": "boolean"
      },
      "source_collection_term": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Source Collection Term"
      },
      "catalog_field_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Catalog Field Name"
      },
      "source_collection_key": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Source Collection Key"
      }
   },
   "required": [
      "source_collection",
      "catalog_field_value_type",
      "is_required"
   ]
}

field catalog_field_name: str | None = None[source]#

The name of the collection referenced in the catalog.

field catalog_field_value_type: str [Required][source]#

The type of the field value.

field is_required: bool [Required][source]#

Specifies if the property must be present in the dataset properties.

field source_collection: str [Required][source]#

The project collection that originated the property.

field source_collection_key: str | None = None[source]#

Specifies a key other than drs_name in the collection.

field source_collection_term: str | None = None[source]#

Specifies a specific term in the collection.

Pydantic model esgvoc.api.project_specs.CatalogSpecification[source]#

Bases: BaseModel

A catalog specifications.

Show JSON schema
{
   "title": "CatalogSpecification",
   "description": "A catalog specifications.",
   "type": "object",
   "properties": {
      "version": {
         "title": "Version",
         "type": "string"
      },
      "catalog_properties": {
         "$ref": "#/$defs/CatalogProperties"
      },
      "dataset_properties": {
         "items": {
            "$ref": "#/$defs/CatalogProperty"
         },
         "title": "Dataset Properties",
         "type": "array"
      },
      "file_properties": {
         "items": {
            "$ref": "#/$defs/CatalogProperty"
         },
         "title": "File Properties",
         "type": "array"
      }
   },
   "$defs": {
      "CatalogExtension": {
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         },
         "required": [
            "name",
            "version"
         ],
         "title": "CatalogExtension",
         "type": "object"
      },
      "CatalogProperties": {
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "url_template": {
               "title": "Url Template",
               "type": "string"
            },
            "extensions": {
               "items": {
                  "$ref": "#/$defs/CatalogExtension"
               },
               "title": "Extensions",
               "type": "array"
            }
         },
         "required": [
            "name",
            "url_template",
            "extensions"
         ],
         "title": "CatalogProperties",
         "type": "object"
      },
      "CatalogProperty": {
         "description": "A dataset property described in a catalog.",
         "properties": {
            "source_collection": {
               "title": "Source Collection",
               "type": "string"
            },
            "catalog_field_value_type": {
               "title": "Catalog Field Value Type",
               "type": "string"
            },
            "is_required": {
               "title": "Is Required",
               "type": "boolean"
            },
            "source_collection_term": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source Collection Term"
            },
            "catalog_field_name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Catalog Field Name"
            },
            "source_collection_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source Collection Key"
            }
         },
         "required": [
            "source_collection",
            "catalog_field_value_type",
            "is_required"
         ],
         "title": "CatalogProperty",
         "type": "object"
      }
   },
   "required": [
      "version",
      "catalog_properties",
      "dataset_properties",
      "file_properties"
   ]
}

field catalog_properties: CatalogProperties [Required][source]#

The properties of the catalog.

field dataset_properties: list[CatalogProperty] [Required][source]#

The properties of the dataset described in a catalog.

field file_properties: list[CatalogProperty] [Required][source]#

The properties of the files described in a catalog.

field version: str [Required][source]#

The version of the catalog.

Pydantic model esgvoc.api.project_specs.DrsPart[source]#

Bases: BaseModel

A fragment of a DRS specification

Show JSON schema
{
   "title": "DrsPart",
   "description": "A fragment of a DRS specification",
   "type": "object",
   "properties": {
      "source_collection": {
         "title": "Source Collection",
         "type": "string"
      },
      "source_collection_term": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Source Collection Term"
      },
      "is_required": {
         "title": "Is Required",
         "type": "boolean"
      }
   },
   "required": [
      "source_collection",
      "is_required"
   ]
}

field is_required: bool [Required][source]#

Whether the collection is required for the DRS specification or not.

field source_collection: str [Required][source]#

The collection id.

field source_collection_term: str | None = None[source]#

Specifies a specific term in the 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"
      },
      "regex": {
         "title": "Regex",
         "type": "string"
      },
      "separator": {
         "title": "Separator",
         "type": "string"
      },
      "properties": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Properties"
      },
      "parts": {
         "items": {
            "$ref": "#/$defs/DrsPart"
         },
         "title": "Parts",
         "type": "array"
      }
   },
   "$defs": {
      "DrsPart": {
         "description": "A fragment of a DRS specification",
         "properties": {
            "source_collection": {
               "title": "Source Collection",
               "type": "string"
            },
            "source_collection_term": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source Collection Term"
            },
            "is_required": {
               "title": "Is Required",
               "type": "boolean"
            }
         },
         "required": [
            "source_collection",
            "is_required"
         ],
         "title": "DrsPart",
         "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",
      "regex",
      "separator",
      "parts"
   ]
}

field parts: list[DrsPart] [Required][source]#

The parts of the DRS specification.

field properties: dict | None = None[source]#

The other specifications (e.g., file name extension for file name DRS specification).

field regex: str [Required][source]#

General pattern for simples checks

field separator: str [Required][source]#

The textual separator string or character.

field type: DrsType [Required][source]#

The type of the specification.

class esgvoc.api.project_specs.DrsType(*values)[source]#

Bases: str, Enum

The types of DRS specification (directory, file name and dataset id).

DATASET_ID = 'dataset_id'[source]#

The DRS dataset id specification type.

DIRECTORY = 'directory'[source]#

The DRS directory specification type.

FILE_NAME = 'file_name'[source]#

The DRS file name specification type.

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": {
         "additionalProperties": {
            "$ref": "#/$defs/DrsSpecification"
         },
         "propertyNames": {
            "$ref": "#/$defs/DrsType"
         },
         "title": "Drs Specs",
         "type": "object"
      },
      "catalog_specs": {
         "anyOf": [
            {
               "$ref": "#/$defs/CatalogSpecification"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "CatalogExtension": {
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         },
         "required": [
            "name",
            "version"
         ],
         "title": "CatalogExtension",
         "type": "object"
      },
      "CatalogProperties": {
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "url_template": {
               "title": "Url Template",
               "type": "string"
            },
            "extensions": {
               "items": {
                  "$ref": "#/$defs/CatalogExtension"
               },
               "title": "Extensions",
               "type": "array"
            }
         },
         "required": [
            "name",
            "url_template",
            "extensions"
         ],
         "title": "CatalogProperties",
         "type": "object"
      },
      "CatalogProperty": {
         "description": "A dataset property described in a catalog.",
         "properties": {
            "source_collection": {
               "title": "Source Collection",
               "type": "string"
            },
            "catalog_field_value_type": {
               "title": "Catalog Field Value Type",
               "type": "string"
            },
            "is_required": {
               "title": "Is Required",
               "type": "boolean"
            },
            "source_collection_term": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source Collection Term"
            },
            "catalog_field_name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Catalog Field Name"
            },
            "source_collection_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source Collection Key"
            }
         },
         "required": [
            "source_collection",
            "catalog_field_value_type",
            "is_required"
         ],
         "title": "CatalogProperty",
         "type": "object"
      },
      "CatalogSpecification": {
         "description": "A catalog specifications.",
         "properties": {
            "version": {
               "title": "Version",
               "type": "string"
            },
            "catalog_properties": {
               "$ref": "#/$defs/CatalogProperties"
            },
            "dataset_properties": {
               "items": {
                  "$ref": "#/$defs/CatalogProperty"
               },
               "title": "Dataset Properties",
               "type": "array"
            },
            "file_properties": {
               "items": {
                  "$ref": "#/$defs/CatalogProperty"
               },
               "title": "File Properties",
               "type": "array"
            }
         },
         "required": [
            "version",
            "catalog_properties",
            "dataset_properties",
            "file_properties"
         ],
         "title": "CatalogSpecification",
         "type": "object"
      },
      "DrsPart": {
         "description": "A fragment of a DRS specification",
         "properties": {
            "source_collection": {
               "title": "Source Collection",
               "type": "string"
            },
            "source_collection_term": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Source Collection Term"
            },
            "is_required": {
               "title": "Is Required",
               "type": "boolean"
            }
         },
         "required": [
            "source_collection",
            "is_required"
         ],
         "title": "DrsPart",
         "type": "object"
      },
      "DrsSpecification": {
         "description": "A DRS specification.",
         "properties": {
            "type": {
               "$ref": "#/$defs/DrsType"
            },
            "regex": {
               "title": "Regex",
               "type": "string"
            },
            "separator": {
               "title": "Separator",
               "type": "string"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Properties"
            },
            "parts": {
               "items": {
                  "$ref": "#/$defs/DrsPart"
               },
               "title": "Parts",
               "type": "array"
            }
         },
         "required": [
            "type",
            "regex",
            "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 catalog_specs: CatalogSpecification | None = None[source]#

The catalog specifications of the project.

field description: str [Required][source]#

The description of the project.

field drs_specs: dict[DrsType, DrsSpecification] [Required][source]#

The DRS specifications of the project (directory, file name and dataset id).

field project_id: str [Required][source]#

The project id.