Tools concerning XML management, simplifying lxml.etree


add(el, field, value)

Add in place a field to a given element

convert_to_xml(src_ds, attributes)

Convert any dataset containing the given attributes to lxml _Element (i.e. netcdf dataset).


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

dict_to_xml(dict_to_cv[, attributes])

Convert any dict containing the given attributes to a lxml _Element.


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


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