Read Firefox sqlite files with Python

Steve D'Aprano steve+python at pearwood.info
Sat Nov 4 21:22:12 EDT 2017


On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote:

> I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5.
> 
> 
> import sqlite3
> con = sqlite3.connect('foo.sqlite')
> with open('dump.sql', 'w') as f:
>     for line in con.iterdump():
>         f.write(line + '\n')


Never mind. I dumped the file using the sqlite3 command line tool. Thank you
to all those who answered.

The file contains three INSERT statements, the first two don't have anything
of interest, and the third (which presumably contains all the data I'm trying
to recover) is an opaque 600+ KB blob.

Naturally. Why would you use a database as a database, when instead you could
just dump a big ball of mud into it?



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list