xml#

Tools concerning XML management, simplifying lxml.etree

Functions

add(el, field, value)

Add in place a field to a given element

convert_to_xml(src_ds, attributes)

Convert any dataset containig the given atgtributes to an XML _Element (i.e.

df_to_xml(src_ds)

Convert a pd.DataFrame or similar (which has a .to_xml() function) to a lxml _Element

read(path)

Read an XML file, even stored on the cloud

read_archive(path[, regex])

Read an XML file from inside an archive (zip or tar) Convenient duplicate of files.read_archived_xml

remove(xml, field)

Remove in place field from a lxml _Element

to_string(xml)

Convert XMl root to string

update_attrib(xml, field, attribute, value)

Update in place an attribute of a field with a given value

update_txt(xml, field, value)

Update in place a text of a field

update_txt_fct(xml, field, fct)

Update in place a text of a field by applying a function to the value of the given field

write(xml, path)

Write an Element to disk