Created
February 21, 2016 16:11
-
-
Save tangotiger/4749236d6b96b193f8fe to your computer and use it in GitHub Desktop.
snippet Loading CSV into SQLite
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
# this takes a standard csv file and then loads it into a databse | |
# question: what if instead of a csv file, I had an equivalent <table><tr><td> formatted file? | |
sourcefile = "skeleton.csv" | |
dshape = discover(resource(sourcefile)) | |
for game_id in list_game_id: | |
sourcefile = "formatted_{g}.csv".format(g=game_id) | |
with open(sourcefile,'r') as infile: | |
odo(sourcefile, targetfile, dshape=dshape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like this is what I'm after: https://pypi.python.org/pypi/xmlutils