Converts XML to a dictionary. Can take inputs from URL, a file and binary data. To convert XML to a dictionary is more than 80% faster than xmltodict module
Use the package manager pip to install nerdlerxml.
pip install nerdlerxmlExample 1:
from nerdlerxml import nerdlerxml
url = "https://example.org/example.xml"
# returns the dictionary of url
result = nerdlerxml(url=url).to_dict()Example 2:
from nerdlerxml import nerdlerxml
filepath = "example.xml"
# returns the dictionary of file
result = nerdlerxml(filepath=filepath).to_dict()Example 3:
from nerdlerxml import nerdlerxml
filepath = "example.xml"
with open(filepath, "rb") as f:
data = f.read()
# returns the dictionary of binary
result = nerdlerxml(fileobject=data).to_dict()