Closed adamsong closed 8 years ago
I'll merge this tomorrow when I push some of my local changes.
Why not print to a csv file?
Here's an idea for more concise code that does print to a csv:
import os,sys,sqlite3
from config import *
conn = sqlite3.connect(DATABASE)
c = conn.cursor()
fd = open('data_dump.csv')
print ','.join(row[1] for row in c.execute('PRAGMA table_info(matches)'))
fd.write(','.join(row[1] for row in c.execute('PRAGMA table_info(matches)')) + '\n')
for row in c.execute('SELECT * FROM matches'):
print ','.join(row)
fd.write(','.join(row) + '\n')
fd.close()
pls merge. Kinda want this
For the teams who would like this data as a spreadsheet this script will dump the matches table as a csv to stdout.