def sqliterepair():
    check_call(['sqlite3', 'C:/sqlite-tools/base.db', '.mode insert',
        '.output C:/sqlite-tools/dump_all.sql', '.dump', '.exit'])
check_call(['sqlite3', 'C:/sqlite-tools/new.db',
    '.read C:/sqlite-tools/dump_all.sql', '.exit'])
return
Dump data from malformed SQLite in Python