pyspc.io.xml.from_xml

Bibliothèque pyspc du projet pyspc - IO - XML - Lecture de fichiers Source : libhydro

Functions

apply_cast(text[, cast])

Return cast(text)

from_file(filename)

Parse le fichier filename et retourne un ElementTree

get_attrib(element, attrib[, cast])

Return cast(element/tag.text) or None.

get_value(element, tag[, cast])

Return cast(element/tag.text) or None.

remove_namespace(element, namespace)

Remove namespace in the passed etree.Element in place.

pyspc.io.xml.from_xml.apply_cast(text, cast=<class 'str'>)[source]

Return cast(text)

pyspc.io.xml.from_xml.from_file(filename)[source]

Parse le fichier filename et retourne un ElementTree

Paramètres:

filename (str) – Nom de fichier XML

Renvoie:

tree – instance ElementTree renvoyée par lxml.etree.parse(filename)

Type renvoyé:

lxml.etree._ElementTree

pyspc.io.xml.from_xml.get_attrib(element, attrib, cast=<class 'str'>)[source]

Return cast(element/tag.text) or None.

pyspc.io.xml.from_xml.get_value(element, tag, cast=<class 'str'>)[source]

Return cast(element/tag.text) or None.

pyspc.io.xml.from_xml.remove_namespace(element, namespace)[source]

Remove namespace in the passed etree.Element in place.