3
votes
1answer
973 views

Reading a large XML file and parsing necessary elements into MySQLdb

I have fair concept in a programming (learner) but not an expert to refactor code at the highest level. I am trying to read a huge (100MB-2GB) XML file and parse necessary element (attributes) from a ...
1
vote
1answer
164 views

Parsing XML file containing some events

I'm a beginner and have written my first Python module that parses a XML file containing some events and prints them out to stdout as JSON. I would appreciate some ...
3
votes
1answer
68 views

Extracting the text of a specific XML node

I have to extract friendlyName from the XML document. Here's my current solution: ...
8
votes
2answers
82 views

Comparing Server Version Number History

I have this code that compares all version numbers of servers. (The version numbers are stored in an XML file) Before the code would compare the current version number with the previous. This caused ...
3
votes
1answer
79 views

Parse XML using Python XML eTree

I am a high school intern, and I am trying to parse my mentor's code so that he can read in an XML file and call simple methods to edit or get information from his XML file. I was hoping someone ...
3
votes
0answers
53 views

DOMDocument field class

Here is the class: ...
4
votes
1answer
179 views

When is (if ever) monkey-patching acceptable? Is there a better solution to this?

I am working on a project that involves xml parsing, and for the job I am using xml.dom.minidom. During development I identified several patterns of processing that I refactored into discrete methods. ...
0
votes
1answer
46 views

Formatting an inventory of parts

There is a text file formatted this way. 51689299 4719 Medium Azure Riding Cycle 51689345 4720c01 Trans-Clear Wheel & Tire Assembly In real ...
2
votes
1answer
290 views

Parsing XML with double nested tags using mindom

I want to retrieve id and name per skill. It works but is it well done? I would like to stay with minidom but all advices will be appreciated. ...
4
votes
1answer
257 views

Recursive XML2JSON parser

I made a Python function that takes an XML file as a parameter and returns a JSON. My goal is to convert some XML get from an old API to convert into Restful API. This function works, but it is ...
2
votes
3answers
142 views

XML-tag function

I'm an experienced programmer, but just a beginner in Python, and would like some input on a small function that's working but which I'm not very happy with. It's used to produce XML tags (strings). ...
2
votes
2answers
866 views

Help fix up my Python XML Schema parsing code

I've been working on a lightweight xml schema parser, and have what I think is a moderately clean solution (some parts helped out by previous questions I posted here) so far for obtaining all schema ...
0
votes
1answer
195 views

Python xml schema parsing for simpleContent and simpleTypes

I am writing a few python functions to parse through an xml schema for reuse later to check and create xml docs in this same pattern. Below are two functions I wrote to parse out data from ...
3
votes
1answer
1k views

Convert elementtree to dict

Just needed a quick way to convert an elementtree element to a dict. I don't care if attributes/elements clash in name, nor namespaces. The XML files are small enough. If an element has multiple ...
4
votes
2answers
5k views

Better way to parse XML in Python

I'm sure there must be a better / simpler way of doing this.... The aim of this code is to return an object which contains all of the movies. Where attributes are not found, they need to return ...
2
votes
1answer
279 views

clean up python file moving script based on xml elements

I wrote a script that is automating the archiving of specific files based on given parameters. The script is crashing on files that are over 500 MB when searching by "special id" or "date", values ...
2
votes
1answer
4k views

Python xml schema parsing and xml creation from flat files - code review

I am new to python and had to create a schema parser to pull information on attributes and complex types, etc. and then convert data from flat files into the proper xml format. We are processing a lot ...
1
vote
1answer
3k views

Python XML parsing and data presentation in Django

I hope this is not a duplicate. For some time now, I've been using a pattern which I think could be done more elegantly. I have a lot of XML files that need to be represented in a Django views. My ...
3
votes
1answer
4k views

Parsing huge xml file with lxml.etree.iterparse in python

After solving the error in SO (like suggested) I return now for codereview. :-) The task is to parse a huge file dblp.xml (~800 MB) presented by DBLP. The records ...