SQLite is included since python 2.5 I connected to a SQLite database created from zotero that way:
import sqlite3 as sqlite
con = sqlite.connect('zotero.sqlite')
cur = con.cursor()
cur.execute('CREATE TABLE foo (o_id INTEGER PRIMARY KEY, fruit VARCHAR(20), veges VARCHAR(30))')
cur.execute('INSERT INTO foo (o_id, fruit, veges) VALUES(NULL, "apple", "broccoli")')
cur.execute('SELECT * FROM foo')
Here is the output:
>pythonw -u "test_sqlite.py"
[(1, u'apple', u'broccoli')]
With help from DZone snippets and devshed. However devsched's information about downloading and building the sqlite library is outdated as it is now included in python.
In a later post, I explain how to connect do an SQLite database with the R statistical software and a package called dplyr.