eml.resources package#

Resources#

Representation of resource objects in the Ecological Metadata Language.

Resource Type#

class eml.resources.resources.EMLResource(value)#

Bases: Enum

Type of the resources described by the EML file.

CITATION = 1#
DATASET = 0#
PROTOCOL = 3#
SOFTWARE = 2#
classmethod get_resource_type(element: Element) EMLResource#

Get the resource type from the tag of one element inside another XML element.

Parameters:
elementlxml.etree.Element

XML element instance.

Returns:
EMLResource

Type of resource.

Raises:
ValueError

If resource type is not a valid type.

Resource Base Class#

class eml.resources.resource.Resource(_id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None, alternative_identifier: List[ExtensionString] = None, short_name: str = None, titles: List[str | I18nString] = None, creators: List[ResponsibleParty] = None, metadata_providers: List[ResponsibleParty] = None, associated_parties: List[Tuple[ResponsibleParty, Role]] = None, publication_date: date = None, language: Language | str = None, series: str = None, abstract: EMLTextType = None, keyword_set: List[EMLKeywordSet] = None, additional_info: List[EMLTextType] = None, intellectual_rights: EMLTextType = None, licensed: List[EMLLicense] = None, distribution: List[EMLDistribution] = None, coverage: EMLCoverage = None, annotation: List[SemanticAnnotation] = None)#

Bases: EMLObject, ABC

Abstract class representing any resources on an EML document

Parameters:
_idstr, optional

Unique identifier

scopeScope, default DOCUMENT

The scope of the identifier.

systemstr, optional

The data management system within which an identifier is in scope and therefore unique.

referencingbool, optional, default=False

Whether the resource is referencing another or is being defined

references_systemstr, optional

System attribute of reference

alternative_identifierList[ExtendedString], optional

A list of secondary identifier for this entity.

short_namestr, optional

A short name that describes the resource, sometimes a filename.

titlesList[I18nString or str]

A brief description of the resource. At least one must be given.

creatorsList[ResponsibleParty]

The people or organizations who created this resource. At least one must be given.

metadata_providersList[ResponsibleParty], optional

The people or organizations who created provided documentation and other metadata for this resource.

associated_partiesList[Tuple[ResponsibleParty, Role]], optional

Other people or organizations who should be associated with this resource.

publication_datedate, optional

The publication date of the resource.

languageLanguage or str, optional

The language in which the resource is written.

seriesstr, optional

The series from which the resource came.

abstractEMLTextType, optional

A brief overview of the resource.

keyword_setList[EMLKeywordSet], optional

Keyword information that describes the resource.

additional_info: List[EMLTextType], optional

Any extra information pertinent to the resource.

intellectual_rightsEMLTextType, optional

Intellectual property rights regarding usage and licensing of this resource.

licensedList[EMLLicense], optional

Information identifying a well-known license for the metadata and data.

distributionList[EMLDistribution], optional

Information on how the resource is distributed online and offline.

coverageEMLCoverage, optional

Extent of the coverage of the resource.

annotationList[SemanticAnnotation], optional

A precisely-defined semantic statement about this resource.

Attributes:
NAMESPACE_TAG
abstract

EMLTextType: A brief overview of the resource.

additional_info

List[EMLTextType]: Any extra information pertinent to the resource.

alternative_identifiers

List[ExtensionString]: A secondary identifier for this entity.

annotation

List[SemanticAnnotation]: A precisely-defined semantic statement about this resource.

associated_party

List[ResponsibleParty]: Other people or organizations who should be associated with this resource.

coverage

EMLCoverage: Extent of the coverage of the resource.

creator

ResponsibleParty: The person or organization who created this resource (First listed).

creators

List[ResponsibleParty]: The people or organizations who created this resource.

distribution

List[EMLDistribution]: Information on how the resource is distributed online and offline.

id

str: Unique identifier of the resource

intellectual_rights

EMLTextType: Any extra information pertinent to the resource.

keyword_set

List[EMLKeywordSet]: Keyword information that describes the resource.

language

Language: The language in which the resource is written.

licensed

List[EMLLicense]: Information identifying a well-known license for the metadata and data.

metadata_provider

List[ResponsibleParty]: The people or organizations who created provided metadata for this resource.

publication_date

date: The publication date of the resource.

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

series

str: The series from which the resource came.

short_name

str: A short name that describes the resource, sometimes a filename.

system

str: The data management system within which an identifier is in scope and therefore unique.

title

I18nString: A brief description of the resource.

titles

List[I18nString]: A brief description of the resource.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

annotate(annotation)

Annotate this resource.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML Object that do not reference another.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Object referencing another EML Object.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

parse_kwargs(element, nmap)

Parse an element to generate the xml_common parameters of Resource classes.

to_element()

Generate an XML Element instance from the Resource.

to_xml()

Generates text of an XML file.

property abstract: EMLTextType#

EMLTextType: A brief overview of the resource.

property additional_info: List[EMLTextType]#

List[EMLTextType]: Any extra information pertinent to the resource.

property alternative_identifiers: List[ExtensionString]#

List[ExtensionString]: A secondary identifier for this entity.

annotate(annotation: SemanticAnnotation) None#

Annotate this resource.

Parameters:
annotationSemanticAnnotation

An annotation in the eml.types.semantic_annotation.SemanticAnnotation instance format.

Raises:
ValueError

If the resource does not have a unique id, it cannot be annotated.

property annotation: List[SemanticAnnotation]#

List[SemanticAnnotation]: A precisely-defined semantic statement about this resource.

property associated_party: List[Tuple[ResponsibleParty, Role]]#

List[ResponsibleParty]: Other people or organizations who should be associated with this resource.

property coverage: EMLCoverage#

EMLCoverage: Extent of the coverage of the resource.

property creator: ResponsibleParty#

ResponsibleParty: The person or organization who created this resource (First listed).

property creators: List[ResponsibleParty]#

List[ResponsibleParty]: The people or organizations who created this resource.

property distribution: List[EMLDistribution]#

List[EMLDistribution]: Information on how the resource is distributed online and offline.

property intellectual_rights: EMLTextType#

EMLTextType: Any extra information pertinent to the resource.

property keyword_set: List[EMLKeywordSet]#

List[EMLKeywordSet]: Keyword information that describes the resource.

property language: Language#

Language: The language in which the resource is written.

property licensed: List[EMLLicense]#

List[EMLLicense]: Information identifying a well-known license for the metadata and data.

property metadata_provider: List[ResponsibleParty]#

List[ResponsibleParty]: The people or organizations who created provided metadata for this resource.

classmethod parse_kwargs(element: Element, nmap: Dict) Dict#

Parse an element to generate the xml_common parameters of Resource classes.

Parameters:
elementlxml.etree.Element

XML element instance.

nmapDict

Namespace.

Returns:
Dict

Other arguments (kwargs) of the recourse class.

property publication_date: date#

date: The publication date of the resource.

property series: str#

str: The series from which the resource came.

property short_name: str#

str: A short name that describes the resource, sometimes a filename.

property title: I18nString#

I18nString: A brief description of the resource.

property titles: List[I18nString]#

List[I18nString]: A brief description of the resource.

to_element() Element#

Generate an XML Element instance from the Resource.

Returns:
lxml.etree.Element

XML element instance.

Citation Resource#

class eml.resources.citation.EMLCitation(**kwargs)#

Bases: Resource

EML Citation Resource.

Other Parameters:
**kwargseml.resources.resource.Resource parameters.

The parameters of every type of Resource.

Attributes:
NAMESPACE_TAG
abstract

EMLTextType: A brief overview of the resource.

additional_info

List[EMLTextType]: Any extra information pertinent to the resource.

alternative_identifiers

List[ExtensionString]: A secondary identifier for this entity.

annotation

List[SemanticAnnotation]: A precisely-defined semantic statement about this resource.

associated_party

List[ResponsibleParty]: Other people or organizations who should be associated with this resource.

coverage

EMLCoverage: Extent of the coverage of the resource.

creator

ResponsibleParty: The person or organization who created this resource (First listed).

creators

List[ResponsibleParty]: The people or organizations who created this resource.

distribution

List[EMLDistribution]: Information on how the resource is distributed online and offline.

id

str: Unique identifier of the resource

intellectual_rights

EMLTextType: Any extra information pertinent to the resource.

keyword_set

List[EMLKeywordSet]: Keyword information that describes the resource.

language

Language: The language in which the resource is written.

licensed

List[EMLLicense]: Information identifying a well-known license for the metadata and data.

metadata_provider

List[ResponsibleParty]: The people or organizations who created provided metadata for this resource.

publication_date

date: The publication date of the resource.

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

series

str: The series from which the resource came.

short_name

str: A short name that describes the resource, sometimes a filename.

system

str: The data management system within which an identifier is in scope and therefore unique.

title

I18nString: A brief description of the resource.

titles

List[I18nString]: A brief description of the resource.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

annotate(annotation)

Annotate this resource.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML citation that do not reference another citation.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Citation referencing another EML Citation.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

parse_kwargs(element, nmap)

Parse an element to generate the xml_common parameters of Resource classes.

to_element()

Generate an XML Element from this object

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'citation'#

str : The principal tag of the XML document.

classmethod get_no_referrer(element: Element, nmap: Dict) EMLCitation#

Generate an EML citation that do not reference another citation.

Parameters:
elementlxml.etree.Element

XML element to parse.

nmapDict

Namespace.

Returns:
EMLCitation

Object parsed.

classmethod get_referrer(element: Element, nmap: Dict) EMLCitation#

Generate an EML Citation referencing another EML Citation.

Parameters:
elementlxml.etree.Element

XML element to parse with references another citation.

nmapDict

Namespace.

Returns:
EMLCitation

Object parsed that reference another citation.

to_element() Element#

Generate an XML Element from this object

Returns:
lxml.etree.Element

XML Element from this object

Dataset Resource#

class eml.resources.dataset.EMLDataset(purpose: EMLTextType = None, introduction: EMLTextType = None, getting_started: EMLTextType = None, acknowledgements: EMLTextType = None, maintenance: Maintenance = None, contact: List[ResponsibleParty] = None, publisher: ResponsibleParty = None, pub_place: str = None, methods: Methods = None, project: ResearchProject = None, **kwargs)#

Bases: Resource

Dataset represents the base type for the dataset element on an EML document.

Parameters:
purposeEMLTextType, optional

A synopsis of the purpose of this dataset.

introductionEMLTextType, optional

An overview of the background and context for the dataset.

getting_startedEMLTextType, optional

A high level overview of interpretation, structure, and content of the dataset.

acknowledgementEMLTextType, optional

Text that acknowledges funders and other key contributors.

maintenanceMaintenance, optional

A description of the maintenance of this data resource.

contactList[ResponsibleParty]

The contact for this dataset.

publisherResponsibleParty, optional

The publisher of this data set.

pub_placestr, optional

The location that the resource was published.

methodsMethods, optional

The methods field documents scientific methods used in the collection of this dataset.

projectResearchProject, optional

The project in which this dataset was collected.

Other Parameters:
**kwargseml.resources.resource.Resource parameters.

The parameters of every type of Resource.

Attributes:
NAMESPACE_TAG
abstract

EMLTextType: A brief overview of the resource.

acknowledgements

EMLTextType: Text that acknowledges funders and other key contributors.

additional_info

List[EMLTextType]: Any extra information pertinent to the resource.

alternative_identifiers

List[ExtensionString]: A secondary identifier for this entity.

annotation

List[SemanticAnnotation]: A precisely-defined semantic statement about this resource.

associated_party

List[ResponsibleParty]: Other people or organizations who should be associated with this resource.

contacts

List[ResponsibleParty]: The contact for this dataset.

coverage

EMLCoverage: Extent of the coverage of the resource.

creator

ResponsibleParty: The person or organization who created this resource (First listed).

creators

List[ResponsibleParty]: The people or organizations who created this resource.

distribution

List[EMLDistribution]: Information on how the resource is distributed online and offline.

getting_started

EMLTextType: A high level overview of interpretation, structure, and content of the dataset.

id

str: Unique identifier of the resource

intellectual_rights

EMLTextType: Any extra information pertinent to the resource.

introduction

EMLTextType: An overview of the background and context for the dataset.

keyword_set

List[EMLKeywordSet]: Keyword information that describes the resource.

language

Language: The language in which the resource is written.

licensed

List[EMLLicense]: Information identifying a well-known license for the metadata and data.

maintenance

Maintenance: A description of the maintenance of this data resource.

metadata_provider

List[ResponsibleParty]: The people or organizations who created provided metadata for this resource.

methods

Methods: The methods field documents scientific methods used in the collection of this dataset.

project

ResearchProject: The project in which this dataset was collected.

pub_place

str: The location that the resource was published.

publication_date

date: The publication date of the resource.

publisher

ResponsibleParty: The publisher of this data set.

purpose

EMLTextType: A synopsis of the purpose of this dataset.

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

series

str: The series from which the resource came.

short_name

str: A short name that describes the resource, sometimes a filename.

system

str: The data management system within which an identifier is in scope and therefore unique.

title

I18nString: A brief description of the resource.

titles

List[I18nString]: A brief description of the resource.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

annotate(annotation)

Annotate this resource.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML Dataset that do not reference another dataset.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Dataset referencing another EML Dataset.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

parse_kwargs(element, nmap)

Parse an element to generate the xml_common parameters of Resource classes.

to_element()

Generates an XML Element from this instance

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'dataset'#

str : The principal tag of the XML document.

property acknowledgements: EMLTextType#

EMLTextType: Text that acknowledges funders and other key contributors.

property contacts: List[ResponsibleParty]#

List[ResponsibleParty]: The contact for this dataset.

classmethod get_no_referrer(element: Element, nmap: Dict) EMLDataset#

Generate an EML Dataset that do not reference another dataset.

Parameters:
elementlxml.etree.Element

XML element to parse.

nmapDict

Namespace.

Returns:
EMLDataset

Object parsed.

classmethod get_referrer(element: Element, nmap: Dict) EMLDataset#

Generate an EML Dataset referencing another EML Dataset.

Parameters:
elementlxml.etree.Element

XML element to parse with references another dataset.

nmapDict

Namespace.

Returns:
EMLDataset

Object parsed that reference another dataset.

property getting_started: EMLTextType#

EMLTextType: A high level overview of interpretation, structure, and content of the dataset.

property introduction: EMLTextType#

EMLTextType: An overview of the background and context for the dataset.

property maintenance: Maintenance#

Maintenance: A description of the maintenance of this data resource.

property methods: Methods#

Methods: The methods field documents scientific methods used in the collection of this dataset.

property project: ResearchProject#

ResearchProject: The project in which this dataset was collected.

property pub_place: str#

str: The location that the resource was published.

property publisher: ResponsibleParty#

ResponsibleParty: The publisher of this data set.

property purpose: EMLTextType#

EMLTextType: A synopsis of the purpose of this dataset.

to_element() Element#

Generates an XML Element from this instance

Returns:
lxml.etree.Element

XML Element from this instance

Protocol Resource#

class eml.resources.protocol.EMLProtocol(**kwargs)#

Bases: Resource

EML Protocol Resource.

Other Parameters:
**kwargseml.resources.resource.Resource parameters.

The parameters of every type of Resource.

Attributes:
NAMESPACE_TAG
abstract

EMLTextType: A brief overview of the resource.

additional_info

List[EMLTextType]: Any extra information pertinent to the resource.

alternative_identifiers

List[ExtensionString]: A secondary identifier for this entity.

annotation

List[SemanticAnnotation]: A precisely-defined semantic statement about this resource.

associated_party

List[ResponsibleParty]: Other people or organizations who should be associated with this resource.

coverage

EMLCoverage: Extent of the coverage of the resource.

creator

ResponsibleParty: The person or organization who created this resource (First listed).

creators

List[ResponsibleParty]: The people or organizations who created this resource.

distribution

List[EMLDistribution]: Information on how the resource is distributed online and offline.

id

str: Unique identifier of the resource

intellectual_rights

EMLTextType: Any extra information pertinent to the resource.

keyword_set

List[EMLKeywordSet]: Keyword information that describes the resource.

language

Language: The language in which the resource is written.

licensed

List[EMLLicense]: Information identifying a well-known license for the metadata and data.

metadata_provider

List[ResponsibleParty]: The people or organizations who created provided metadata for this resource.

publication_date

date: The publication date of the resource.

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

series

str: The series from which the resource came.

short_name

str: A short name that describes the resource, sometimes a filename.

system

str: The data management system within which an identifier is in scope and therefore unique.

title

I18nString: A brief description of the resource.

titles

List[I18nString]: A brief description of the resource.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

annotate(annotation)

Annotate this resource.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML protocol that do not reference another protocol.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Protocol referencing another EML Protocol.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

parse_kwargs(element, nmap)

Parse an element to generate the xml_common parameters of Resource classes.

to_element()

Generate an XML Element from this object

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'protocol'#

str : The principal tag of the XML document.

classmethod get_no_referrer(element: Element, nmap: Dict) EMLProtocol#

Generate an EML protocol that do not reference another protocol.

Parameters:
elementlxml.etree.Element

XML element to parse.

nmapDict

Namespace.

Returns:
EMLProtocol

Object parsed.

classmethod get_referrer(element: Element, nmap: Dict) EMLProtocol#

Generate an EML Protocol referencing another EML Protocol.

Parameters:
elementlxml.etree.Element

XML element to parse with references another protocol.

nmapDict

Namespace.

Returns:
EMLProtocol

Object parsed that reference another protocol.

to_element() Element#

Generate an XML Element from this object

Returns:
lxml.etree.Element

XML Element from this object

Software Resource#

class eml.resources.software.EMLSoftware(**kwargs)#

Bases: Resource

EML Software Resource.

Other Parameters:
**kwargseml.resources.resource.Resource parameters.

The parameters of every type of Resource.

Attributes:
NAMESPACE_TAG
abstract

EMLTextType: A brief overview of the resource.

additional_info

List[EMLTextType]: Any extra information pertinent to the resource.

alternative_identifiers

List[ExtensionString]: A secondary identifier for this entity.

annotation

List[SemanticAnnotation]: A precisely-defined semantic statement about this resource.

associated_party

List[ResponsibleParty]: Other people or organizations who should be associated with this resource.

coverage

EMLCoverage: Extent of the coverage of the resource.

creator

ResponsibleParty: The person or organization who created this resource (First listed).

creators

List[ResponsibleParty]: The people or organizations who created this resource.

distribution

List[EMLDistribution]: Information on how the resource is distributed online and offline.

id

str: Unique identifier of the resource

intellectual_rights

EMLTextType: Any extra information pertinent to the resource.

keyword_set

List[EMLKeywordSet]: Keyword information that describes the resource.

language

Language: The language in which the resource is written.

licensed

List[EMLLicense]: Information identifying a well-known license for the metadata and data.

metadata_provider

List[ResponsibleParty]: The people or organizations who created provided metadata for this resource.

publication_date

date: The publication date of the resource.

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

series

str: The series from which the resource came.

short_name

str: A short name that describes the resource, sometimes a filename.

system

str: The data management system within which an identifier is in scope and therefore unique.

title

I18nString: A brief description of the resource.

titles

List[I18nString]: A brief description of the resource.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

annotate(annotation)

Annotate this resource.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML software that do not reference another software.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Software referencing another EML Software.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

parse_kwargs(element, nmap)

Parse an element to generate the xml_common parameters of Resource classes.

to_element()

Generate an XML Element from this object

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'software'#

str : The principal tag of the XML document.

classmethod get_no_referrer(element: Element, nmap: Dict) EMLSoftware#

Generate an EML software that do not reference another software.

Parameters:
elementlxml.etree.Element

XML element to parse.

nmapDict

Namespace.

Returns:
EMLSoftware

Object parsed.

classmethod get_referrer(element: Element, nmap: Dict) EMLSoftware#

Generate an EML Software referencing another EML Software.

Parameters:
elementlxml.etree.Element

XML element to parse with references another software.

nmapDict

Namespace.

Returns:
EMLSoftware

Object parsed that reference another software.

to_element() Element#

Generate an XML Element from this object

Returns:
lxml.etree.Element

XML Element from this object

Resource Group#

Representation of resource group objects that are defined as children of a Resource object.

KeywordSet Class#

class eml.resources.keyword_set.EMLKeywordSet(keywords: List[str | I18nString], thesaurus: str = None, keywords_type: List[KeywordType] = None)#

Bases: XMLObject

Keyword information that describes the resource.

Parameters:
keywordsList[I18nString, str]

A list of keywords that describes the resource.

thesaurusstr, optional

The name of a thesaurus from which the keyword is derived.

keywords_typeList[KeywordType], optional

A list of the type of each keyword.

Attributes:
NAMESPACE_TAG
keywords

List[I18nString]: A list of keywords that describes the resource.

keywords_type

List[KeywordType]: A list of the type of each keyword.

thesaurus

str: The name of a thesaurus from which the keyword is derived.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Generate an EMLKeywordSet from an XML element.

to_element()

Get an XML Element from the EMLKeywordSet object

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'keywordSet'#

str : The principal tag of the XML document.

property keywords: List[I18nString]#

List[I18nString]: A list of keywords that describes the resource.

property keywords_type: List[KeywordType]#

List[KeywordType]: A list of the type of each keyword.

classmethod parse(element: Element, nmap: Dict) EMLKeywordSet | None#

Generate an EMLKeywordSet from an XML element.

Parameters:
elementlxml.etree.Element

XML Element to be parsed.

nmapDict

Namespace of the XML element.

Returns:
EMLKeyword

Parsed object

property thesaurus: str#

str: The name of a thesaurus from which the keyword is derived.

to_element() Element#

Get an XML Element from the EMLKeywordSet object

Returns:
lxml.etree.Element

XML Element with the information of the EMLAbstract instance

class eml.resources.keyword_set.KeywordType(value)#

Bases: Enum

The type of each keyword.

Attributes:
PLACEint

Keywords pertaining to a spatial location.

STRATUMint

Keywords pertaining to a vertical stratum.

TEMPORALint

Keywords pertaining to temporal data.

THEMEint

Keywords pertaining to thematic subject.

TAXONOMICint

Keywords pertaining to taxon information.

NULL = 0#
PLACE = 1#
STRATUM = 2#
TAXONOMIC = 6#
TEMPORAL = 4#
THEME = 5#

License Class#

class eml.resources.licence.EMLLicense(name: str, url: str = None, identifier: str = None)#

Bases: XMLObject

Information identifying a well-known license for the metadata and data.

Parameters:
namestr

The official name of the license.

urlstr, optional

The persistent URL for the license.

identifierstr, optional

License Identifier.

Attributes:
NAMESPACE_TAG
id

str: License Identifier.

name

str: The official name of the license.

url

str: The persistent URL for the license.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Generate an EMLLicense object from a given XML element.

to_element()

Generate an XML element with EMLLicense instance information.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'licensed'#

str : The principal tag of the XML document.

property id: str#

str: License Identifier.

property name: str#

str: The official name of the license.

classmethod parse(element: Element, nmap: Dict) EMLLicense | None#

Generate an EMLLicense object from a given XML element.

Parameters:
elementlxml.etree.Element

XML element to parse

nmapDict

Namespace

Returns:
EMLLicense

Parsed object

to_element() Element#

Generate an XML element with EMLLicense instance information.

Returns:
lxml.etree.Element

XML element object

property url: str#

str: The persistent URL for the license.

Distribution Class#

class eml.resources.distribution.distribution.EMLDistribution(_id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None, online: EMLOnline = None, offline: EMLOffline = None, inline: EMLInline = None)#

Bases: EMLObject

Information on how the resource is distributed online and offline.

Parameters:
_idstr, optional

Unique identifier within the scope.

scopeScope, default DOCUMENT

The scope of the identifier.

systemstr, optional

The data management system within which an identifier is in scope and therefore unique.

referencingbool, optional, default=False

Whether the resource is referencing another or is being defined.

references_systemstr, optional

System attribute of reference.

onlineEMLOnline, optional

Online distribution information.

offlineEMLOffline, optional

Data are available offline.

inlineEMLInline, optional

Data distributed inline in the metadata.

Attributes:
NAMESPACE_TAG
id

str: Unique identifier of the resource

inline

EMLInline: Data distributed inline in the metadata.

offline

EMLOffline: Data are available offline.

online

EMLOnline: Online distribution information.

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

system

str: The data management system within which an identifier is in scope and therefore unique.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML Distribution that do not reference another.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Distribution referencing another EML Distribution.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

to_element()

Generate an XML element with EMLDistribution instance information.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'distribution'#

str : The principal tag of the XML document.

classmethod get_no_referrer(element: Element, nmap: Dict) EMLDistribution#

Generate an EML Distribution that do not reference another.

Parameters:
elementlxml.etree.Element

XML element to parse.

nmapDict

Namespace.

Returns:
EMLObject

Object parsed.

classmethod get_referrer(element: Element, nmap: Dict) EMLDistribution#

Generate an EML Distribution referencing another EML Distribution.

Parameters:
elementlxml.etree.Element

XML element to parse with references object.

nmapDict

Namespace.

Returns:
EMLDistribution

Object parsed that reference another.

property inline: EMLInline#

EMLInline: Data distributed inline in the metadata.

property offline: EMLOffline#

EMLOffline: Data are available offline.

property online: EMLOnline#

EMLOnline: Online distribution information.

to_element() Element#

Generate an XML element with EMLDistribution instance information.

Returns:
lxml.etree.Element

XML element object

Distribution accessory classes#

Coverage Class#

class eml.resources.coverage.coverage.EMLCoverage(geographic: GeographicCoverage = None, temporal: TemporalCoverage = None, taxonomic: TaxonomicCoverage = None, _id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None)#

Bases: EMLObject

Extent of the coverage of the resource.

Parameters:
geographic: GeographicCoverage

Geographic coverage information.

temporal: TemporalCoverage

Temporal coverage information.

taxonomic: TaxonomicCoverage

Taxonomic coverage information.

_idstr, optional

Unique identifier within the scope.

scopeScope, default DOCUMENT

The scope of the identifier.

systemstr, optional

The data management system within which an identifier is in scope and therefore unique.

referencingbool, optional, default=False

Whether the resource is referencing another or is being defined.

references_systemstr, optional

System attribute of reference.

Attributes:
NAMESPACE_TAG
geographic

GeographicCoverage: Geographic coverage information.

id

str: Unique identifier of the resource

references

bool: Whether the resource is referencing another or is being defined

referencing

bool: Whether the resource is referencing another or is being defined

scope

Scope: The scope of the identifier.

system

str: The data management system within which an identifier is in scope and therefore unique.

taxonomic

TaxonomicCoverage: Taxonomic coverage information.

temporal

TemporalCoverage: Temporal coverage information.

Methods

add_namespace(prefix, uri)

Add a namespace to the XML object.

check_principal_tag(tag, nmap)

Checks if the tag is the Principal tag of the object.

from_string(text)

Generates XML Object from a string of an XML file.

from_xml(file[, encoding])

Generates an XML Object from an XML file.

generate_references_element()

Generate the <references> element.

get_no_referrer(element, nmap)

Generate an EML Coverage that do not reference another.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate an EML Coverage referencing another EML Coverage.

get_scope(element)

Get the scope from the element.

object_to_element(tag[, prefix])

Generates an element using tag, adding namespace tag.

parse(element, nmap)

Common parse of an EML object

to_element()

Generate an XML element instance.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'coverage'#

str : The principal tag of the XML document.

property geographic: GeographicCoverage#

GeographicCoverage: Geographic coverage information.

classmethod get_no_referrer(element: Element, nmap: Dict) EMLCoverage#

Generate an EML Coverage that do not reference another.

Parameters:
elementlxml.etree.Element

XML element to parse.

nmapDict

Namespace.

Returns:
EMLCoverage

Object parsed.

classmethod get_referrer(element: Element, nmap: Dict) EMLCoverage#

Generate an EML Coverage referencing another EML Coverage.

Parameters:
elementlxml.etree.Element

XML element to parse with references object.

nmapDict

Namespace.

Returns:
EMLCoverage

Object parsed that reference another.

property taxonomic: TaxonomicCoverage#

TaxonomicCoverage: Taxonomic coverage information.

property temporal: TemporalCoverage#

TemporalCoverage: Temporal coverage information.

to_element() Element#

Generate an XML element instance.

Returns:
lxml.etree.Element

XML element instance.

Coverage accessory classes#