import sqlite3
import csv
con = sqlite3.connect('mydatabase.db')
outfile = open('mydump.csv', 'wb')
outcsv = csv.writer(outfile)
cursor = con.execute('select * from mytable')
outcsv.writerow(x[0] for x in cursor.description)
outcsv.writerows(cursor.fetchall())
outfile.close()
дамп csv из sqlalchemy