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:
XMLObjectOnline 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
connectionEMLOnline.Connection: A connection to a data service.
connection_definitionEMLOnline.ConnectionDefinition: Definition of the connection protocol.
online_descriptionstr: Brief description of the content of online.
urlstr: A URL from which this resource can be downloaded or information can be obtained about downloading it.
url_functionEMLOnline.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.
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:
EMLObjectA 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_definitionEMLOnline.ConnectionDefinition: Definition of the connection protocol.
idstr: Unique identifier of the resource
parametersList[Tuple[str, str]]: A parameter to be used to make this connection.
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 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
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:
EMLObjectDefinition 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
descriptionEMLTextType: The description of the scheme used to identify this connection.
idstr: Unique identifier of the resource
parametersList[EMLOnline.ParameterDefinition]: List of parameters that are needed to use this connection scheme.
referencesbool: Whether the resource is referencing another or is being defined
referencingbool: Whether the resource is referencing another or is being defined
scheme_nameExtensionString: The name of the scheme used to identify this connection.
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 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
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
- PRINCIPAL_TAG = 'online'#
str : The principal tag of the XML document.
- class ParameterDefinition(name: str, definition: str, default_value: str = None)#
Bases:
XMLObjectThe 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_valuestr: The default value for 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.
namestr: 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
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:
XMLObjectOffline 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_densitystr : Density of the digital medium if this is relevant.
medium_density_unitsstr : Numerical density’s units.
medium_formatList[str]: Format of the medium on which this resource is shipped.
medium_namestr: Name of the medium that for this resource distribution.
medium_notestr: Note about the media.
medium_volumestr: 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.
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:
XMLObjectInline 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.
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.