Questions tagged [xmltodict]

Python module that makes working with XML feel like you are working with JSON.

xmltodict is a Python module that makes working with XML feel like you are working with JSON

Check it on Pypi here.

120 questions
0
votes
1 answer

Python reading third tag using xmltodict

Part of the XML file: HT knooppuntIntercitystation Den Bosch 's-Hertogenbosch
Proxi Henn
  • 35
  • 1
  • 1
  • 6
0
votes
1 answer

OrderedDict: Unable Return the item of d with key key. Raises a KeyError

Accessing xmltodict converted values. I have an xml that looks like this E90 I am trying to access the CASE dictionary. If I remove the…
J.D
  • 45
  • 1
  • 6
0
votes
2 answers

Add package to specific install of Python in Linux

I am trying to add xmltodict package to Python on Linux. I have 2 installations of Python on my Linux build; Python 2.7 (default) and Python 3.5 (in the form of an Anaconda installation). I want to add xmltodict to the Python 3 installation, but…
WRJ
  • 617
  • 3
  • 9
  • 19
0
votes
2 answers

Cannot pull data from XML files due to differences in format

I have a script that takes a bunch of XML files, all in the form of: HMDB61152.xml and pulls them all in using glob. For each file I need to pull some details about each, such as accession, name, and a list of diseases. To parse through each XML I…
Andras Palfi
  • 206
  • 3
  • 12
0
votes
0 answers

add items to OrderedDict via function call

I'm new to python and don't know a lot about data structures, I'm trying to append extra items to an ordered dictionary via a call to a function. The goal is making an xml file with xmltodict. OrderedDict([ ('@attr1', 'aa'), …
mao
  • 1,059
  • 2
  • 23
  • 43
0
votes
1 answer

get data from URL XML with python and xmltodict

I'm trying in python2.7 with xmltodict ext. get data from app engine API (XML type). Got no idea of how doing that... I tried to do so with local XML (I download it from source url) with success my local code look like this: import…
Tzahi Kadosh
  • 397
  • 2
  • 9
  • 21
0
votes
1 answer

Problems with python 3.4 and xmltodict

I have this python script: import xmltodict with open('file.xml') as fd: doc = xmltodict.parse(fd.read()) print("Name=" + doc['Data']['form'][0]['@Name']) print("Time=" + doc['Data']['form'][0]['Period']['@Time']) …
Firefly
  • 449
  • 5
  • 20
0
votes
0 answers

xmltodict - no element line 1 column 0

I am receiving this error in python 2.7 and 3.5 on ubuntu that expat cannot read the first element. xml.parsers.expat.ExpatError: no element found: line 1, column 0 Line 1 looks quite normal for and has parsed before.
sayth
  • 6,696
  • 12
  • 58
  • 100
0
votes
1 answer

Parsing large XML file using 'xmltodict' module results in OverflowError

I have a fairly large XML File of about 3GB size that I am wanting to parse in streaming mode using 'xmltodict' utility. The code I have iterates through each item and forms a dictionary item and appends to the dictionary in memory, eventually to be…
chetfaker
  • 11
  • 1
  • 5
0
votes
1 answer

xmltodict throwing errors when used in a .py file

I want to get xmltodict in python2.7 up and running for a project I have, so I started by copy-pasting from the only example I was able to find import xmltodict with open ('test.xml') as fd: doc = xmltodict.parse(fd.read()) print doc Trying…
KBriggs
  • 1,220
  • 2
  • 18
  • 43
0
votes
1 answer

Most efficient way to convert one XML to a different XML file in python xmltodict, elementTree etc

Howdie do, So I have the following two XML files. File A: 5108046
Jimmy
  • 887
  • 1
  • 10
  • 24
-1
votes
1 answer

Converting an xml to dictionary

I have an XML file like this: id-1 title-1 desc-1
Hooman Bahreini
  • 14,480
  • 11
  • 70
  • 137
-1
votes
1 answer

No module named 'xmltodict'

I'm trying to convert an XML to JSON using 'xmltodict' My code: import xmltodict import json with open('ELT.xml') as inFh: with open('ELT.json','w') as outFh: json.dump(xmltodict.parse(inFh.read()), outFh) The error: import…
Kyle Marvin
  • 29
  • 1
  • 3
-1
votes
1 answer

Retrieving data from xml.

I have an xml file through which I have to retrieve xml document. Below is the xml document i have. - - - - -
user3419487
  • 185
  • 1
  • 9
-2
votes
1 answer

Python - how to pars this nested xml file?

I am trying to parse this nested xml file into a data frame. Here is the sample of xml: 2020-08-10T12:19:26-04:00
Slavisha84
  • 747
  • 3
  • 7
  • 22
1 2 3 4 5 6 7
8