eml.resources.distribution package#

Distribution Online Class#

class eml.resources.distribution.online.EMLOnline(online_description: str = None, url: str = None, url_function: FunctionType = None, connection: Connection = None, connection_definition: ConnectionDefinition = None)#

Bases: XMLObject

Online distribution information.

Parameters:
online_descriptionI18nString or str, optional

Brief description of the content of online.

urlstr, optional

A URL from which this resource can be downloaded or information can be obtained about downloading it.

url_functionEMLOnline.FunctionType, optional

“information” when the URL meant for informational purposes or “download” URL returns the data stream itself.

connectionEMLOnline.Connection, optional

A connection to a data service.

connection_definitionEMLOnline.ConnectionDefinition, optional

The definition of a connection that will be used in another location in the EML document.

Attributes:
NAMESPACE_TAG
connection

EMLOnline.Connection: A connection to a data service.

connection_definition

EMLOnline.ConnectionDefinition: Definition of the connection protocol.

online_description

str: Brief description of the content of online.

url

str: A URL from which this resource can be downloaded or information can be obtained about downloading it.

url_function

EMLOnline.FunctionType: Function of the url.

Methods

Connection([_id, scope, system, ...])

A description of the information needed to make an application connection to a data service.

ConnectionDefinition([_id, scope, system, ...])

Definition of the connection protocol.

FunctionType(value)

Function of the URL.

ParameterDefinition(name, definition[, ...])

The definition of a parameter that is needed to properly use this connection scheme.

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 EMLOnline instance from an XML element.

to_element()

Generate an XML element from an Online instance.

to_xml()

Generates text of an XML file.

class Connection(_id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None, connection_definition: ConnectionDefinition = None, parameters: List[Tuple[str, str]] = None)#

Bases: EMLObject

A description of the information needed to make an application connection to a data service.

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.

connection_definitionEMLOnline.ConnectionDefinition, optional

Definition of the connection protocol.

parametersList[Tuple[str, str]], optional

A parameter to be used to make this connection.

Attributes:
NAMESPACE_TAG
connection_definition

EMLOnline.ConnectionDefinition: Definition of the connection protocol.

id

str: Unique identifier of the resource

parameters

List[Tuple[str, str]]: A parameter to be used to make this connection.

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 a Connection instance from an XML element.

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate a Connection instance referencing another instance.

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 instance information.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'connection'#

str : The principal tag of the XML document.

property connection_definition: ConnectionDefinition#

EMLOnline.ConnectionDefinition: Definition of the connection protocol.

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

Generate a Connection instance from an XML element.

Parameters:
elementlxml.etree.Element

An XML element instance to parse.

nmapDict

Namespace.

Returns:
EMLOnline.Connection

Instance with the information from the XML element.

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

Generate a Connection instance referencing another instance.

Parameters:
elementlxml.etree.Element

An XML element instance to parse.

nmapDict

Namespace.

Returns:
EMLOnline.Connection

Instance of Connection referencing another.

property parameters: List[Tuple[str, str]]#

List[Tuple[str, str]]: A parameter to be used to make this connection.

to_element() Element#

Generate an XML Element with instance information.

Returns:
lxml.etree.Element

An XML Element instance.

class ConnectionDefinition(_id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None, scheme_name: ExtensionString = None, description: EMLTextType = None, parameters: List[ParameterDefinition] = None)#

Bases: EMLObject

Definition of the connection protocol.

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.

scheme_nameExtensionString, optional

The name of the scheme used to identify this connection.

descriptionEMLTextType, optional

The description of the scheme used to identify this connection.

parametersList[EMLOnline.ParameterDefinition], optional

A list of definitions of a parameter that is needed to properly use this connection scheme.

Attributes:
NAMESPACE_TAG
description

EMLTextType: The description of the scheme used to identify this connection.

id

str: Unique identifier of the resource

parameters

List[EMLOnline.ParameterDefinition]: List of parameters that are needed to use this connection scheme.

references

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

referencing

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

scheme_name

ExtensionString: The name of the scheme used to identify this connection.

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 a ConnectionDefinition object from an XML element

get_principal_tag()

Returns the principal tag with namespaces if it is present.

get_referrer(element, nmap)

Generate a ConnectionDefinition object referencing another from an XML element

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 the instance information.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'connectionDefinition'#

str: Principal tag connectionDefinition

property description: EMLTextType#

EMLTextType: The description of the scheme used to identify this connection.

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

Generate a ConnectionDefinition object from an XML element

Parameters:
elementlxml.etree.Element

XML element object to parse

nmapDict

Namespace

Returns:
EMLOnline.ConnectionDefinition

Instance parsed from XML Element

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

Generate a ConnectionDefinition object referencing another from an XML element

Parameters:
elementlxml.etree.Element

XML element object to parse

nmapDict

Namespace

Returns:
EMLOnline.ConnectionDefinition

Instance parsed from XML Element

property parameters: List[ParameterDefinition]#

List[EMLOnline.ParameterDefinition]: List of parameters that are needed to use this connection scheme.

property scheme_name: ExtensionString#

ExtensionString: The name of the scheme used to identify this connection.

to_element() Element#

Generate an XML element with the instance information.

Returns:
lxml.etree.Element

XML Element instance

class FunctionType(value)#

Bases: Enum

Function of the URL.

DOWNLOAD = 0#
INFORMATION = 1#
PRINCIPAL_TAG = 'online'#

str : The principal tag of the XML document.

class ParameterDefinition(name: str, definition: str, default_value: str = None)#

Bases: XMLObject

The definition of a parameter that is needed to properly use this connection scheme.

Parameters:
namestr

The Name of a parameter that is needed to properly use this connection scheme.

definitionstr

The definition of a parameter that is needed to properly use this connection scheme.

default_valuestr, optional

The default value for a parameter that is needed to properly use this connection scheme.

Attributes:
NAMESPACE_TAG
default_value

str: The default value for a parameter that is needed to properly use this connection scheme.

definition

str: The definition of a parameter that is needed to properly use this connection scheme.

name

str: The Name of a parameter that is needed to properly use this connection scheme.

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)

Parse an XML element into a ParameterDefinition object

to_element()

Generate an XML element from Parameter Definition instance

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'parameterDefinition'#

str: Principal tag parameterDefinition

property default_value: str#

str: The default value for a parameter that is needed to properly use this connection scheme.

property definition: str#

str: The definition of a parameter that is needed to properly use this connection scheme.

property name: str#

str: The Name of a parameter that is needed to properly use this connection scheme.

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

Parse an XML element into a ParameterDefinition object

Parameters:
elementxml.etree.Element

XML element to be parsed

nmapDict

Namespace

Returns:
EMLOnline.ParameterDefinition

Instance with the information of the XML element

to_element() Element#

Generate an XML element from Parameter Definition instance

Returns:
xml.etree.Element

XML element instance with the Parameter Definition information

property connection: Connection#

EMLOnline.Connection: A connection to a data service.

property connection_definition: ConnectionDefinition#

EMLOnline.ConnectionDefinition: Definition of the connection protocol.

property online_description: str#

str: Brief description of the content of online.

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

Generate an EMLOnline instance from an XML element.

Parameters:
elementlxml.etree.Element

An XML element instance.

nmapDict

Namespace.

Returns:
EMLOnline

Instance parsed.

to_element() Element#

Generate an XML element from an Online instance.

Returns:
lxml.etree.Element

XML element with EMLOnline instance information.

property url: str#

str: A URL from which this resource can be downloaded or information can be obtained about downloading it.

property url_function: FunctionType#

EMLOnline.FunctionType: Function of the url.

Distribution Offline Class#

class eml.resources.distribution.offline.EMLOffline(medium_name: str, medium_density: str = None, medium_density_units: str = None, medium_volume: str = None, medium_format: List[str] = None, medium_note: str = None)#

Bases: XMLObject

Offline distribution when data are available offline.

Parameters:
medium_namestr

Name of the medium that for this resource distribution.

medium_densitystr, optional

The density of the digital medium if this is relevant.

medium_density_unitsstr, optional

A numerical density’s units.

medium_volumestr, optional

Total volume of the storage medium.

medium_formatList[str], optional

Format of the medium on which the resource is shipped.

medium_notestr, optional

Note about the media.

Attributes:
NAMESPACE_TAG
medium_density

str : Density of the digital medium if this is relevant.

medium_density_units

str : Numerical density’s units.

medium_format

List[str]: Format of the medium on which this resource is shipped.

medium_name

str: Name of the medium that for this resource distribution.

medium_note

str: Note about the media.

medium_volume

str: Total volume of the storage medium.

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 EMLOffline object from an XML element.

to_element()

Generate an XML element with the information of the EMLOffline instance.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'offline'#

str: Principle tag offline.

property medium_density: str#

str : Density of the digital medium if this is relevant.

property medium_density_units: str#

str : Numerical density’s units.

property medium_format: List[str]#

List[str]: Format of the medium on which this resource is shipped.

property medium_name: str#

str: Name of the medium that for this resource distribution.

property medium_note: str#

str: Note about the media.

property medium_volume: str#

str: Total volume of the storage medium.

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

Generate an EMLOffline object from an XML element.

Parameters:
elementlxml.etree.Element

An XML element.

nmapDict

Namespace.

Returns:
EMLOffline

Instance with the offline media distribution.

to_element() Element#

Generate an XML element with the information of the EMLOffline instance.

Returns:
lxml.etree.Element

XML element with the information of the EMLOffline.

Distribution Inline Class#

class eml.resources.distribution.inline.EMLInline#

Bases: XMLObject

Inline distribution.

Attributes:
NAMESPACE_TAG

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 EMLInline instance from an XML element.

to_element()

Generate an XML element instance with the information of the EMLInline object.

to_xml()

Generates text of an XML file.

PRINCIPAL_TAG = 'inline'#

str : The principal tag of the XML document.

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

Generate an EMLInline instance from an XML element.

Parameters:
elementlxml.etree.Element

XML Element to be parsed.

nmapDict

Namespace.

Returns:
EMLInline

An instance with the information of the XML element.

to_element() Element#

Generate an XML element instance with the information of the EMLInline object.

Returns:
lxml.etree.Element

XML element instance.