eml.types package#
Classes with no predefine Principal Tag#
_NoTagObject Base Class#
- class eml.types.no_tag_object._NoTagObject#
Bases:
XMLObject,ABCAbstract class of object with no tag on EML schema
- Attributes:
- NAMESPACE_TAG
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Always return True due tag not existing until set
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)Parses a lxml element into an XMLObject.
set_tag(tag)Set tag for the element output.
Generate a lxml.tree.Element from the Responsible Party object.
to_xml()Generates text of an XML file.
- classmethod check_principal_tag(tag: str, nmap: Dict) None#
Always return True due tag not existing until set
- Parameters:
- tagstr
Any tag.
- nmapDict
Namespace.
- set_tag(tag: str) None#
Set tag for the element output.
- Parameters:
- tagstr
Tag of the XML output element.
- to_element() Element#
Generate a lxml.tree.Element from the Responsible Party object.
- Returns:
- lxml.tree.Element
Object in the XML Element format.
- Raises:
- RuntimeError
If tag is not set before calling this method.
Extension String Class#
- class eml.types.extension_string.ExtensionString(value: str | ExtensionString, system: str = None)#
Bases:
_NoTagObjectExtension string representing a string value with extra attributes.
- Parameters:
- valuestr | ExtensionString
Value of the string or another ExtensionString object.
- systemstr, optional
The data management system.
- Attributes:
- NAMESPACE_TAG
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)Always return True due tag not existing until set
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)Parses a lxml element into an Extension String.
set_tag(tag)Set tag for the element output.
Generate a lxml.tree.Element from the extended string.
to_xml()Generates text of an XML file.
- classmethod parse(element: Element, nmap: Dict) ExtensionString | None#
Parses a lxml element into an Extension String.
- Parameters:
- elementlxml.tree.Element
Object in the Element format to be parsed into a Python object.
- nmapDict
Dictionary of namespace.
- Returns:
- ExtensionString
Object parsed.
- property system: str#
str: The data management system within which an identifier is in scope and therefore unique.
- to_element() Element#
Generate a lxml.tree.Element from the extended string.
- Returns:
- lxml.tree.Element
Object in the XML Element format.
- Raises:
- RuntimeError
If tag is not set before calling this method.
Extension URI Class#
- class eml.types.extension_uri.ExtensionURI(value: str, label: str)#
Bases:
_NoTagObjectExtension URI representing an uri value with extra attributes.
- Parameters:
- valuestr
Value of the URI.
- labelstr
A human-readable representation of the URI.
- Attributes:
- NAMESPACE_TAG
labelstr: A human-readable representation of the URI.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Always return True due tag not existing until set
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 ExtensionURI object from an XML element instance.
set_tag(tag)Set tag for the element output.
Generate an XML element with the information of the extension URI.
to_xml()Generates text of an XML file.
- property label: str#
str: A human-readable representation of the URI.
- classmethod parse(element: Element, nmap: Dict) ExtensionURI | None#
Generate an ExtensionURI object from an XML element instance.
- Parameters:
- elementlxml.etree.Element
An XML element instance.
- nmapDict
Namespace.
- Returns:
- ExtensionURI
An URI with a human-readable label.
- to_element() Element#
Generate an XML element with the information of the extension URI.
- Returns:
- lxml.etree.Element
An XML element instance.
i18n String Class#
- class eml.types.i18n_string.I18nString(value: str | I18nString, lang: Language | str = Language.ENG)#
Bases:
_NoTagObjectInternationalization of a string representing a text and its language.
- Parameters:
- valuestr or I18nString
Value of the string.
- langLanguage or str
Language of the string or valid abbreviation. Default ENG (English).
- Raises:
- TypeError
Wrong language type.
- NotImplementedError
Abbreviation not available yet or wrong language.
- Attributes:
- NAMESPACE_TAG
languageLanguage: The language of the string.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Always return True due tag not existing until set
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)Parses a lxml element into an i18n String.
set_tag(tag)Set tag for the element output.
Generate a lxml.tree.Element from the i18n string.
to_xml()Generates text of an XML file.
- classmethod parse(element: Element, nmap: Dict) I18nString | None#
Parses a lxml element into an i18n String.
- Parameters:
- elementlxml.tree.Element
Object in the Element format to be parsed into a Python object.
- nmapDict
Dictionary of namespace.
- Returns:
- I18nString
Object parsed.
- to_element() Element#
Generate a lxml.tree.Element from the i18n string.
- Returns:
- lxml.tree.Element
Object in the XML Element format.
- Raises:
- RuntimeError
If tag is not set before calling this method.
TextType Class#
- class eml.types.text_type.EMLTextType(sections: List[EMLSection] = None, paragraphs: List[str | I18nString] = None, markdowns: List[str] = None, language: Language = Language.ENG)#
Bases:
_NoTagObjectA simple text description.
- Parameters:
- sectionsList[EMLSection], optional
A section of related text.
- paragraphsList[I18String or str], optional
A simple paragraph of text.
- markdownsList[str], optional
A block of text formatted with Markdown directives.
- languageLanguage, optional
Language of abstract.
- Attributes:
- NAMESPACE_TAG
languageLanguage: Language of the text.
markdownsList[str]: A block of text formatted with Markdown directives.
paragraphsList[I18nString]: A simple paragraph of text.
sectionsList[EMLSection]: A section of related text.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Always return True due tag not existing until set
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 EMLTextType from an XML element.
set_tag(tag)Set tag for the element output.
Get an XML Element from the EMLTextType object
to_xml()Generates text of an XML file.
- property markdowns: List[str]#
List[str]: A block of text formatted with Markdown directives.
- property paragraphs: List[I18nString]#
List[I18nString]: A simple paragraph of text.
- classmethod parse(element: Element, nmap: Dict) EMLTextType | None#
Generate an EMLTextType from an XML element.
- Parameters:
- elementlxml.etree.Element
XML Element to be parsed.
- nmapDict
Namespace of the XML element.
- Returns:
- EMLTextType
Parsed object
- property sections: List[EMLSection]#
List[EMLSection]: A section of related text.
- to_element() Element#
Get an XML Element from the EMLTextType object
- Returns:
- lxml.etree.Element
XML Element with the information of the EMLTextType instance
Responsible Party Class#
- class eml.types.responsible_party.ResponsibleParty(_id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None, individual_name: IndividualName = None, organization_name: OrganizationName = None, position_name: PositionName = None, address: List[EMLAddress] = None, phone: List[EMLPhone] = None, mail: List[str | I18nString] = None, url: List[str] = None)#
Bases:
EMLObject,_NoTagObjectThe individual, organization, or role associated with a resource.
- 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.
- individual_nameIndividualName, optional
The full name of the person being described.
- organization_nameOrganizationName, optional
The full name of the organization being described.
- position_namePositionName, optional
The name of the title or position associated with the resource.
- addressList[EMLAddress], optional
A list of full addresses information for a given responsible party entry.
- phoneList[EMLPhone], optional
A list of phone information about the contact.
- mailList[str or I18nString], optional
A list of email addresses of the contact.
- urlList[str], optional
A list of links to associated online information, usually a website.
- Attributes:
- NAMESPACE_TAG
addressList[EMLAddress]: A list of full addresses information for a given responsible party entry.
idstr: Unique identifier of the resource
individual_nameIndividualName: the full name of the person being described.
mailList[I18nString]: A list of email addresses of the contact.
organization_nameOrganizationName: The full name of the organization being described.
phoneList[EMLPhone]: A list of phon information about the contact.
position_namePositionName: The name of the title or position associated with 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.
urlList[str]: A list of links to associated online information, usually a website.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Always return True due tag not existing until set
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 Responsible Party that do not reference another.
get_principal_tag()Returns the principal tag with namespaces if it is present.
get_referrer(element, nmap)Generate a Responsible Party referencing another Responsible Party.
get_role(element, nmap)Get role for 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
set_tag(tag)Set tag for the element output.
Generate a lxml.tree.Element from the Responsible Party object.
to_xml()Generates text of an XML file.
- property address: List[EMLAddress]#
List[EMLAddress]: A list of full addresses information for a given responsible party entry.
- classmethod get_no_referrer(element: Element, nmap: Dict) ResponsibleParty#
Generate a Responsible Party that do not reference another.
- Parameters:
- elementlxml.etree.Element
XML element to parse.
- nmapDict
Namespace.
- Returns:
- ResponsibleParty
Object parsed.
- classmethod get_referrer(element: Element, nmap: Dict) ResponsibleParty#
Generate a Responsible Party referencing another Responsible Party.
- Parameters:
- elementlxml.etree.Element
XML element to parse with references object.
- nmapDict
Namespace.
- Returns:
- ResponsibleParty
Object parsed that reference another responsible party on document.
- classmethod get_role(element: Element, nmap: Dict) Role#
Get role for an XML element.
- Parameters:
- elementlxml.etree.Element
XML element with role on it.
- nmapDict
Namespace.
- Returns:
- Role
Value of the role inside the XML element.
- property individual_name: IndividualName#
IndividualName: the full name of the person being described.
- property mail: List[I18nString]#
List[I18nString]: A list of email addresses of the contact.
- property organization_name: OrganizationName#
OrganizationName: The full name of the organization being described.
- property position_name: PositionName#
PositionName: The name of the title or position associated with the resource.
- to_element() Element#
Generate a lxml.tree.Element from the Responsible Party object.
- Returns:
- lxml.tree.Element
Object in the XML Element format.
- Raises:
- RuntimeError
If tag is not set before calling this method.
- property url: List[str]#
List[str]: A list of links to associated online information, usually a website.
- class eml.types.responsible_party.Role(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
CamelCaseEnumThe role the party played with respect to the resource.
- AUTHOR = 0#
- CONTENT_PROVIDER = 1#
- CUSTODIAN_STEWARD = 2#
- DISTRIBUTOR = 3#
- EDITOR = 4#
- METADATA_PROVIDER = 5#
- ORIGINATOR = 6#
- POINT_OF_CONTACT = 7#
- PRINCIPAL_INVESTIGATOR = 8#
- PROCESSOR = 9#
- PUBLISHER = 10#
- USER = 11#
Semantic Annotation Class#
- class eml.types.semantic_annotation.SemanticAnnotation(property_uri: Tuple[str, str], value_uri: Tuple[str, str], _id: str = None, scope: Scope = Scope.DOCUMENT, system: str = None)#
Bases:
EMLObject,_NoTagObjectA precisely-defined semantic statement about this resource.
- Parameters:
- property_uriTuple[str, str]
The persistent URI used to identify a property from a vocabulary.
- value_uriTuple[str, str]
The persistent URI used to identify a value from a vocabulary.
- _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.
- Attributes:
- NAMESPACE_TAG
idstr: Unique identifier of the resource
property_uriExtensionURI: The persistent URI used to identify a property from a vocabulary.
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.
value_uriExtensionURI: The persistent URI used to identify a value from a vocabulary.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Always return True due tag not existing until set
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 Semantic Annotation from an XML element instance.
get_principal_tag()Returns the principal tag with namespaces if it is present.
get_referrer(element, nmap)Semantic Annotation doesn't have a reference.
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
set_tag(tag)Set tag for the element output.
Generate an XML element instance.
to_xml()Generates text of an XML file.
- classmethod get_no_referrer(element: Element, nmap: Dict) SemanticAnnotation#
Generate a Semantic Annotation from an XML element instance.
- Parameters:
- elementlxml.etree.Element
XML element to parse.
- nmapDict
Namespace.
- Returns:
- SemanticAnnotation
Object parsed.
- classmethod get_referrer(element: Element, nmap: Dict) SemanticAnnotation#
Semantic Annotation doesn’t have a reference. This method raise an exception.
- Parameters:
- elementlxml.etree.Element
XML element to parse with references object.
- nmapDict
Namespace.
- Returns:
- SemanticAnnotation
Object parsed that would reference another.
- Raises:
- ValueError
Semantic Annotation cannot reference another annotation.
- property property_uri: ExtensionURI#
ExtensionURI: The persistent URI used to identify a property from a vocabulary.
- to_element() Element#
Generate an XML element instance.
- Returns:
- lxml.etree.Element
XML element instance.
- property value_uri: ExtensionURI#
ExtensionURI: The persistent URI used to identify a value from a vocabulary.
Classes with predefine Principal Tag#
Section Class#
- class eml.types.section.EMLSection(title: I18nString | str = None, paragraph: I18nString | str = None, section: EMLSection = None, language: Language = Language.ENG)#
Bases:
XMLObjectA section of related text.
The “section” element allows for grouping related paragraphs of text together, with an optional title.
- Parameters:
- titleI18nString or str, optional
The optional title of the section.
- paragraphI18String or str, optional
A simple paragraph of text. If section is not given, this parameter is mandatory.
- sectionSection, optional
A section of related text. If paragraph is not given, this parameter is mandatory.
- languageLanguage, optional
Language of section. Default “ENG”
- 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 EMLSection from an XML element.
Get an XML Element from the EMLSection object
to_xml()Generates text of an XML file.
- PRINCIPAL_TAG = 'section'#
str : The principal tag of the XML document.
- property paragraph: I18nString#
I18nString: A simple paragraph of text.
- classmethod parse(element: Element, nmap: Dict) EMLSection | None#
Generate an EMLSection from an XML element.
- Parameters:
- elementlxml.etree.Element
XML Element to be parsed.
- nmapDict
Namespace of the XML element.
- Returns:
- EMLSection
Parsed object
- property section: EMLSection#
EMLSection: A section of related text.
- property title: I18nString#
I18nString: The optional title of the section.
- to_element() Element#
Get an XML Element from the EMLSection object
- Returns:
- lxml.etree.Element
XML Element with the information of the EMLSection instance
Individual Name Class#
- class eml.types.individual_name.IndividualName(last_name: str | I18nString, first_name: str | I18nString | List[I18nString] = None, salutation: str | I18nString | List[I18nString] = None, language: Language = None)#
Bases:
XMLObjectClass representing the full name of the person being described.
- Parameters:
- last_namestr or I18nString
The last name of the individual.
- first_namestr, I18nString or List[I18nString], optional
The given name of the individual.
- salutationstr, I18nString or List[I18nString], optional
The salutation used to address an individual.
- languageLanguage, optional
In case of given, the language of all the parameters given
- Attributes:
- NAMESPACE_TAG
first_nameList[I18nString]: The given name of the individual.
last_nameI18nString: The last name of the individual.
salutationList[I18nString]: The salutation used to address an individual.
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.
lang(language)Returns the individual name text representation in the given language.
object_to_element(tag[, prefix])Generates an element using tag, adding namespace tag.
parse(element, nmap)Parses a lxml element into an IndividualName object.
Generates a lxml.tree.Element from the object.
to_xml()Generates text of an XML file.
- PRINCIPAL_TAG = 'individualName'#
str : The principal tag of the XML document.
- property first_name: List[I18nString]#
List[I18nString]: The given name of the individual.
- lang(language: Language) str#
Returns the individual name text representation in the given language.
- Parameters:
- languageLanguage
The language to get the text representation.
- Returns:
- str
Text representation of object in the selected language
- property last_name: I18nString#
I18nString: The last name of the individual.
- classmethod parse(element: Element, nmap: Dict) IndividualName | None#
Parses a lxml element into an IndividualName object.
- Parameters:
- elementlxml.tree.Element
Object in the Element format to be parsed into a Python object.
- nmapDict
Dictionary of namespace.
- Returns:
- IndividualName
Object parsed.
- property salutation: List[I18nString]#
List[I18nString]: The salutation used to address an individual.
- to_element() Element#
Generates a lxml.tree.Element from the object.
- Returns:
- lxml.tree.Element
Object in the Element format.
Organization Name Class#
- class eml.types.organization_name.OrganizationName(value: str | I18nString, lang: Language | str = Language.ENG)#
Bases:
I18nStringThe full name of the organization being described.
- Attributes:
- NAMESPACE_TAG
languageLanguage: The language of the string.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Checks if the tag is "organizationName"
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)Parses a lxml element into an Organization Name.
set_tag(tag)To not be used.
Generate a lxml.tree.Element from the organization name.
to_xml()Generates text of an XML file.
- PRINCIPAL_TAG = 'organizationName'#
str : The principal tag of the XML document.
- classmethod check_principal_tag(tag: str, nmap: Dict) None#
Checks if the tag is “organizationName”
- Parameters:
- tagstr
Tag obtained from outside source.
- nmapDict
The namespace to check the format of the principal tag.
- Raises:
- AssertionError
If the tag is not a representation of the principal tag of the object.
- classmethod parse(element: Element, nmap: Dict) OrganizationName | None#
Parses a lxml element into an Organization Name.
- Parameters:
- elementlxml.tree.Element
Object in the Element format to be parsed into a Python object.
- nmapDict
Dictionary of namespace.
- Returns:
- OrganizationName
Object parsed.
- set_tag(tag: str) None#
To not be used.
- Parameters:
- tagstr
Any tag.
- to_element() Element#
Generate a lxml.tree.Element from the organization name.
- Returns:
- lxml.tree.Element
Object in the XML Element format.
Position Name Class#
- class eml.types.position_name.PositionName(value: str | I18nString, lang: Language | str = Language.ENG)#
Bases:
I18nStringThe name of the title or position associated with the resource.
- Attributes:
- NAMESPACE_TAG
languageLanguage: The language of the string.
Methods
add_namespace(prefix, uri)Add a namespace to the XML object.
check_principal_tag(tag, nmap)Checks if the tag is "positionName"
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)Parses a lxml element into an Organization Name.
set_tag(tag)To not be used.
Generate a lxml.tree.Element from the position name.
to_xml()Generates text of an XML file.
- PRINCIPAL_TAG = 'positionName'#
str : The principal tag of the XML document.
- classmethod check_principal_tag(tag: str, nmap: Dict) None#
Checks if the tag is “positionName”
- Parameters:
- tagstr
Tag obtained from outside source.
- nmapDict
The namespace to check the format of the principal tag.
- Raises:
- AssertionError
If the tag is not a representation of the principal tag of the object.
- classmethod parse(element: Element, nmap: Dict) PositionName | None#
Parses a lxml element into an Organization Name.
- Parameters:
- elementlxml.tree.Element
Object in the Element format to be parsed into a Python object.
- nmapDict
Dictionary of namespace.
- Returns:
- OrganizationName
Object parsed.
- set_tag(tag: str) None#
To not be used.
- Parameters:
- tagstr
Any tag.
- to_element() Element#
Generate a lxml.tree.Element from the position name.
- Returns:
- lxml.tree.Element
Object in the XML Element format.
Address Class#
- class eml.types.address.EMLAddress(_id: str = None, scope: ~eml.types.eml_object.Scope = Scope.DOCUMENT, system: str = None, referencing: bool = False, references_system: str = None, delivery_point: str | ~eml.types.i18n_string.I18nString | ~typing.List[~eml.types.i18n_string.I18nString] = None, city: str | ~eml.types.i18n_string.I18nString = None, administrative_area: str | ~eml.types.i18n_string.I18nString = None, postal_code: str | ~eml.types.i18n_string.I18nString = None, country: str | ~eml.types.i18n_string.I18nString = None, language: <Language.ENG: 'English'> = None)#
Bases:
EMLObjectThe full address information for a given responsible party entry.
- 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
- delivery_pointstr, I18nString or List[I18String], optional
The location for postal deliveries.
- citystr or I18nString, optional
The name of the city for the contact.
- administrative_areastr or I18nString, optional
The political area of a country.
- postal_codestr or I18nString, optional
The postal code used for routing to an address.
- countrystr or I18nString, optional
The name of the country for the contact’s address.
- Attributes:
- NAMESPACE_TAG
administrative_areaI18nString: The political area of a country.
cityI18String: The name of the city for the contact.
countryI18nString: The name of the country for the contact’s address.
delivery_pointList[I18nString]: The location for postal deliveries.
idstr: Unique identifier of the resource
postal_codeI18nString: The postal code used for routing to an address.
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 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 Address referencing another EML Address.
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 a lxml.tree.Element from the object.
to_xml()Generates text of an XML file.
- PRINCIPAL_TAG = 'address'#
str : The principal tag of the XML document.
- property administrative_area: I18nString#
I18nString: The political area of a country.
- property city: I18nString#
I18String: The name of the city for the contact.
- property country: I18nString#
I18nString: The name of the country for the contact’s address.
- property delivery_point: List[I18nString]#
List[I18nString]: The location for postal deliveries.
- classmethod get_no_referrer(element: Element, nmap: Dict) EMLAddress#
Generate an EML Object that do not reference another.
- Parameters:
- elementlxml.etree.Element
XML element to parse.
- nmapDict
Namespace.
- Returns:
- EMLAddress
Object parsed.
- classmethod get_referrer(element: Element, nmap: Dict) EMLAddress#
Generate an EML Address referencing another EML Address.
- Parameters:
- elementlxml.etree.Element
XML element to parse with references EML address.
- nmapDict
Namespace.
- Returns:
- EMLAddress
Object parsed that reference an Address.
- property postal_code: I18nString#
I18nString: The postal code used for routing to an address.
- to_element() Element#
Generate a lxml.tree.Element from the object.
- Returns:
- lxml.tree.Element
Object in the Element format.
Phone Class#
- class eml.types.phone.EMLPhone(phone: str, phone_type: str = 'voice')#
Bases:
XMLObjectInformation about the contact’s telephone.
- Parameters:
- phonestr
The phone field describes information about the responsible party’s telephone.
- phone_typestr, optional
The type of the phone to which this number applies. Default “voice”.
- Attributes:
- NAMESPACE_TAG
phonestr: The phone field describes information about the responsible party’s telephone.
phone_typestr: The type of the phone to which this number applies.
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)Parses a lxml element into an EML Phone object.
Generates a lxml.tree.Element from the EML Phone object.
to_xml()Generates text of an XML file.
- PRINCIPAL_TAG = 'phone'#
str : The principal tag of the XML document.
- classmethod parse(element: Element, nmap: Dict) EMLPhone | None#
Parses a lxml element into an EML Phone object.
- Parameters:
- elementlxml.tree.Element
Object in the Element format to be parsed into a Python object.
- nmapDict
Dictionary of namespace.
- Returns:
- XMLObject
Object parsed.
- property phone: str#
str: The phone field describes information about the responsible party’s telephone.
- property phone_type: str#
str: The type of the phone to which this number applies.
- to_element() Element#
Generates a lxml.tree.Element from the EML Phone object.
- Returns:
- lxml.tree.Element
Object in the Element format.