Created
November 29, 2014 18:57
-
-
Save hunterowens/92d9286461979fd400f6 to your computer and use it in GitHub Desktop.
XML->CSV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmltodict | |
import json | |
import pandas as pd | |
file = open('/path/to/file.xml','r') | |
str = file.read() | |
dictionary = xmltodict.parse(str) | |
df = pd.DataFrame(dictionary) | |
# Do any parsing of the XML file here, as you'll want to confirm that you are writing the correct info to csv. | |
df.to_csv('/path/to/output.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment