Profile

pydantic model geometamaker.models.Profile[source]

Class for a metadata profile.

A Profile can store metadata properties that are likely to apply to more than one resource, such as contact and license.

Show JSON schema
{
   "title": "Profile",
   "description": "Class for a metadata profile.\n\nA Profile can store metadata properties that are likely to apply\nto more than one resource, such as ``contact`` and ``license``.",
   "type": "object",
   "properties": {
      "contact": {
         "$ref": "#/$defs/ContactSchema",
         "description": "Contact information for the data author."
      },
      "license": {
         "$ref": "#/$defs/LicenseSchema",
         "description": "Data license information."
      }
   },
   "$defs": {
      "ContactSchema": {
         "additionalProperties": false,
         "description": "Class for storing contact information of data author.",
         "properties": {
            "email": {
               "default": "",
               "title": "Email",
               "type": "string"
            },
            "organization": {
               "default": "",
               "title": "Organization",
               "type": "string"
            },
            "individual_name": {
               "default": "",
               "title": "Individual Name",
               "type": "string"
            },
            "position_name": {
               "default": "",
               "title": "Position Name",
               "type": "string"
            }
         },
         "title": "ContactSchema",
         "type": "object"
      },
      "LicenseSchema": {
         "additionalProperties": false,
         "description": "Class for storing data license information.",
         "properties": {
            "path": {
               "default": "",
               "description": "URL that describes the license.",
               "title": "Path",
               "type": "string"
            },
            "title": {
               "default": "",
               "description": "Name of a license, such as one from http://licenses.opendefinition.org/",
               "title": "Title",
               "type": "string"
            }
         },
         "title": "LicenseSchema",
         "type": "object"
      }
   },
   "additionalProperties": false
}

field contact: ContactSchema [Optional]

Contact information for the data author.

field license: LicenseSchema [Optional]

Data license information.

classmethod load(filepath)[source]

Load metadata document from a yaml file.

Parameters:

filepath (str) – path to yaml file

Returns:

instance of the class

get_contact()

Get metadata from a contact section.

Returns:

ContactSchema

get_license()

Get license for the dataset.

Returns:

models.LicenseSchema

replace(other)

Replace attribute values with those from another instance.

Only attributes that exist in self will exist in the returned instance. Only attribute values that are not empty in other will be used to replace values in self.

Parameters:

other (BaseMetadata)

Returns:

an instance of same type as self

Raises:

TypeError if other is not an instance of BaseMetadata.

set_contact(organization=None, individual_name=None, position_name=None, email=None)

Add a contact section.

Parameters:
  • organization (str) – name of the responsible organization

  • individual_name (str) – name of the responsible person

  • position_name (str) – role or position of the responsible person

  • email (str) – address of the responsible organization or individual

set_license(title=None, path=None)

Add a license for the dataset.

Either or both title and path are required if there is a license. Call with no arguments to remove license info.

Parameters:
  • title (str) – human-readable title of the license

  • path (str) – url for the license

write(target_path)[source]

Write profile data to a yaml file.

Parameters:

target_path (str) – path to a yaml file to be written