xmltodict
xmltodict makes working with XML feel like you are working with JSON. The current version is 1.0.4, with regular updates and bug fixes.
Warnings
- breaking Version 1.0.0 dropped legacy compatibility paths for Python 2.x.
- gotcha Avoid using outdated patterns to import the library.
Install
-
pip install xmltodict
Imports
- xmltodict
import xmltodict
Quickstart
import xmltodict xml_str = '<foo><bar value="1">test</bar></foo>' dict_obj = xmltodict.parse(xml_str) print(dict_obj)