Skip to content

Instantly share code, notes, and snippets.

@tangotiger
Created February 21, 2016 16:11
Show Gist options
  • Save tangotiger/4749236d6b96b193f8fe to your computer and use it in GitHub Desktop.
Save tangotiger/4749236d6b96b193f8fe to your computer and use it in GitHub Desktop.
snippet Loading CSV into SQLite
# 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)
@tangotiger
Copy link
Author

Looks like this is what I'm after: https://pypi.python.org/pypi/xmlutils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment