Python XML to Dict parser
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Looking for some python 3.x to parse the XML in the link below, specifically need to iterate over tags. The actual xml files are over 400mb and contain thousands of and have many more tags under and many more
I would like something similar to:

import xmltodict

x_file = 'afile.xml'

with open(x_file) as fd:

doc = xmltodict.parse(

for item in doc.items():


This would generate something like for each item:

{ 'title': "title a", 'project':"12345" ..... }

xml extract:



Crowdsource coding tasks.

1 Solution


Hello broadreach,

Here is the code for your specification.
An example output can be found here.

Thank you,

Thanks Vladimir, elegant solution as usual!
broadreach almost 2 years ago
Thank you! Happy to hear that you are satisfied with the solution!
VladimirMikulic almost 2 years ago
View Timeline