eml.resources package#
Resources#
Representation of resource objects in the Ecological Metadata Language.
Resource Type#
- class eml.resources.resources.EMLResource(value)#
Bases:
EnumType 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,ABCAbstract 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
abstractEMLTextType: A brief overview of the resource.
additional_infoList[EMLTextType]: Any extra information pertinent to the resource.
alternative_identifiersList[ExtensionString]: A secondary identifier for this entity.
annotationList[SemanticAnnotation]: A precisely-defined semantic statement about this resource.
associated_partyList[ResponsibleParty]: Other people or organizations who should be associated with this resource.
coverageEMLCoverage: Extent of the coverage of the resource.
creatorResponsibleParty: The person or organization who created this resource (First listed).
creatorsList[ResponsibleParty]: The people or organizations who created this resource.
distributionList[EMLDistribution]: Information on how the resource is distributed online and offline.
idstr: Unique identifier of the resource
intellectual_rightsEMLTextType: Any extra information pertinent to the resource.
keyword_setList[EMLKeywordSet]: Keyword information that describes the resource.
languageLanguage: The language in which the resource is written.
licensedList[EMLLicense]: Information identifying a well-known license for the metadata and data.
metadata_providerList[ResponsibleParty]: The people or organizations who created provided metadata for this resource.
publication_datedate: The publication date of the resource.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
seriesstr: The series from which the resource came.
short_namestr: A short name that describes the resource, sometimes a filename.
systemstr: The data management system within which an identifier is in scope and therefore unique.
titleI18nString: A brief description of the resource.
titlesList[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.
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.SemanticAnnotationinstance 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 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:
ResourceEML Citation Resource.
- Other Parameters:
- **kwargs
eml.resources.resource.Resourceparameters. The parameters of every type of Resource.
- **kwargs
- Attributes:
- NAMESPACE_TAG
abstractEMLTextType: A brief overview of the resource.
additional_infoList[EMLTextType]: Any extra information pertinent to the resource.
alternative_identifiersList[ExtensionString]: A secondary identifier for this entity.
annotationList[SemanticAnnotation]: A precisely-defined semantic statement about this resource.
associated_partyList[ResponsibleParty]: Other people or organizations who should be associated with this resource.
coverageEMLCoverage: Extent of the coverage of the resource.
creatorResponsibleParty: The person or organization who created this resource (First listed).
creatorsList[ResponsibleParty]: The people or organizations who created this resource.
distributionList[EMLDistribution]: Information on how the resource is distributed online and offline.
idstr: Unique identifier of the resource
intellectual_rightsEMLTextType: Any extra information pertinent to the resource.
keyword_setList[EMLKeywordSet]: Keyword information that describes the resource.
languageLanguage: The language in which the resource is written.
licensedList[EMLLicense]: Information identifying a well-known license for the metadata and data.
metadata_providerList[ResponsibleParty]: The people or organizations who created provided metadata for this resource.
publication_datedate: The publication date of the resource.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
seriesstr: The series from which the resource came.
short_namestr: A short name that describes the resource, sometimes a filename.
systemstr: The data management system within which an identifier is in scope and therefore unique.
titleI18nString: A brief description of the resource.
titlesList[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.
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:
ResourceDataset 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:
- **kwargs
eml.resources.resource.Resourceparameters. The parameters of every type of Resource.
- **kwargs
- Attributes:
- NAMESPACE_TAG
abstractEMLTextType: A brief overview of the resource.
acknowledgementsEMLTextType: Text that acknowledges funders and other key contributors.
additional_infoList[EMLTextType]: Any extra information pertinent to the resource.
alternative_identifiersList[ExtensionString]: A secondary identifier for this entity.
annotationList[SemanticAnnotation]: A precisely-defined semantic statement about this resource.
associated_partyList[ResponsibleParty]: Other people or organizations who should be associated with this resource.
contactsList[ResponsibleParty]: The contact for this dataset.
coverageEMLCoverage: Extent of the coverage of the resource.
creatorResponsibleParty: The person or organization who created this resource (First listed).
creatorsList[ResponsibleParty]: The people or organizations who created this resource.
distributionList[EMLDistribution]: Information on how the resource is distributed online and offline.
getting_startedEMLTextType: A high level overview of interpretation, structure, and content of the dataset.
idstr: Unique identifier of the resource
intellectual_rightsEMLTextType: Any extra information pertinent to the resource.
introductionEMLTextType: An overview of the background and context for the dataset.
keyword_setList[EMLKeywordSet]: Keyword information that describes the resource.
languageLanguage: The language in which the resource is written.
licensedList[EMLLicense]: Information identifying a well-known license for the metadata and data.
maintenanceMaintenance: A description of the maintenance of this data resource.
metadata_providerList[ResponsibleParty]: The people or organizations who created provided metadata for this resource.
methodsMethods: The methods field documents scientific methods used in the collection of this dataset.
projectResearchProject: The project in which this dataset was collected.
pub_placestr: The location that the resource was published.
publication_datedate: The publication date of the resource.
publisherResponsibleParty: The publisher of this data set.
purposeEMLTextType: A synopsis of the purpose of this dataset.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
seriesstr: The series from which the resource came.
short_namestr: A short name that describes the resource, sometimes a filename.
systemstr: The data management system within which an identifier is in scope and therefore unique.
titleI18nString: A brief description of the resource.
titlesList[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.
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:
ResourceEML Protocol Resource.
- Other Parameters:
- **kwargs
eml.resources.resource.Resourceparameters. The parameters of every type of Resource.
- **kwargs
- Attributes:
- NAMESPACE_TAG
abstractEMLTextType: A brief overview of the resource.
additional_infoList[EMLTextType]: Any extra information pertinent to the resource.
alternative_identifiersList[ExtensionString]: A secondary identifier for this entity.
annotationList[SemanticAnnotation]: A precisely-defined semantic statement about this resource.
associated_partyList[ResponsibleParty]: Other people or organizations who should be associated with this resource.
coverageEMLCoverage: Extent of the coverage of the resource.
creatorResponsibleParty: The person or organization who created this resource (First listed).
creatorsList[ResponsibleParty]: The people or organizations who created this resource.
distributionList[EMLDistribution]: Information on how the resource is distributed online and offline.
idstr: Unique identifier of the resource
intellectual_rightsEMLTextType: Any extra information pertinent to the resource.
keyword_setList[EMLKeywordSet]: Keyword information that describes the resource.
languageLanguage: The language in which the resource is written.
licensedList[EMLLicense]: Information identifying a well-known license for the metadata and data.
metadata_providerList[ResponsibleParty]: The people or organizations who created provided metadata for this resource.
publication_datedate: The publication date of the resource.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
seriesstr: The series from which the resource came.
short_namestr: A short name that describes the resource, sometimes a filename.
systemstr: The data management system within which an identifier is in scope and therefore unique.
titleI18nString: A brief description of the resource.
titlesList[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.
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:
ResourceEML Software Resource.
- Other Parameters:
- **kwargs
eml.resources.resource.Resourceparameters. The parameters of every type of Resource.
- **kwargs
- Attributes:
- NAMESPACE_TAG
abstractEMLTextType: A brief overview of the resource.
additional_infoList[EMLTextType]: Any extra information pertinent to the resource.
alternative_identifiersList[ExtensionString]: A secondary identifier for this entity.
annotationList[SemanticAnnotation]: A precisely-defined semantic statement about this resource.
associated_partyList[ResponsibleParty]: Other people or organizations who should be associated with this resource.
coverageEMLCoverage: Extent of the coverage of the resource.
creatorResponsibleParty: The person or organization who created this resource (First listed).
creatorsList[ResponsibleParty]: The people or organizations who created this resource.
distributionList[EMLDistribution]: Information on how the resource is distributed online and offline.
idstr: Unique identifier of the resource
intellectual_rightsEMLTextType: Any extra information pertinent to the resource.
keyword_setList[EMLKeywordSet]: Keyword information that describes the resource.
languageLanguage: The language in which the resource is written.
licensedList[EMLLicense]: Information identifying a well-known license for the metadata and data.
metadata_providerList[ResponsibleParty]: The people or organizations who created provided metadata for this resource.
publication_datedate: The publication date of the resource.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
seriesstr: The series from which the resource came.
short_namestr: A short name that describes the resource, sometimes a filename.
systemstr: The data management system within which an identifier is in scope and therefore unique.
titleI18nString: A brief description of the resource.
titlesList[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.
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:
XMLObjectKeyword 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
keywordsList[I18nString]: A list of keywords that describes the resource.
keywords_typeList[KeywordType]: A list of the type of each keyword.
thesaurusstr: 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.
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:
EnumThe 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:
XMLObjectInformation 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:
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.
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:
EMLObjectInformation 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
idstr: Unique identifier of the resource
inlineEMLInline: Data distributed inline in the metadata.
offlineEMLOffline: Data are available offline.
onlineEMLOnline: Online distribution information.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
systemstr: 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
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 offline: EMLOffline#
EMLOffline: Data are available offline.
- 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:
EMLObjectExtent 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
geographicGeographicCoverage: Geographic coverage information.
idstr: Unique identifier of the resource
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scopeScope: The scope of the identifier.
systemstr: The data management system within which an identifier is in scope and therefore unique.
taxonomicTaxonomicCoverage: Taxonomic coverage information.
temporalTemporalCoverage: 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
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#
- eml.resources.coverage package
- GeographicCoverage Class
GeographicCoverageGeographicCoverage.PRINCIPAL_TAGGeographicCoverage.altitude_units_boundingGeographicCoverage.descriptionGeographicCoverage.east_boundingGeographicCoverage.g_polygonGeographicCoverage.get_no_referrer()GeographicCoverage.get_referrer()GeographicCoverage.max_altitude_boundingGeographicCoverage.min_altitude_boundingGeographicCoverage.north_boundingGeographicCoverage.polygon_to_xml()GeographicCoverage.ring_to_xml()GeographicCoverage.south_boundingGeographicCoverage.to_element()GeographicCoverage.west_boundingGeographicCoverage.xml_to_polygon()GeographicCoverage.xml_to_ring()
- TemporalCoverage Class
TemporalCoverageTemporalCoverage.AlternativeTimeScaleTemporalCoverage.PRINCIPAL_TAGTemporalCoverage.datetime_to_xml()TemporalCoverage.get_no_referrer()TemporalCoverage.get_referrer()TemporalCoverage.range_datetimeTemporalCoverage.single_datetimeTemporalCoverage.to_element()TemporalCoverage.xml_to_datetime()
- TaxonomicCoverage Class
TaxonomicCoverageTaxonomicCoverage.ClassificationSystemTaxonomicCoverage.PRINCIPAL_TAGTaxonomicCoverage.TaxonIDTaxonomicCoverage.TaxonomicClassificationTaxonomicCoverage.TaxonomicSystemTaxonomicCoverage.VoucherTaxonomicCoverage.classificationTaxonomicCoverage.general_coverageTaxonomicCoverage.get_no_referrer()TaxonomicCoverage.get_referrer()TaxonomicCoverage.taxonomic_systemTaxonomicCoverage.to_element()
- GeographicCoverage Class