python sqlite driver
See the code
cysqlite provides performant bindings to SQLite. cysqlite aims to be roughly
compatible with the behavior of the standard lib sqlite3 module.
cysqlite supports standalone builds or dynamic-linking with the system SQLite.
cysqlite is a Cython-based SQLite driver that provides:

cysqlite can be installed as a pre-built binary wheel with SQLite embedded into the module:
pip install cysqlite
cysqlite can be installed from a source distribution (sdist) which will link against the system SQLite:
# Link against the system sqlite.
pip install --no-binary :all: cysqlite
Self-contained builds embedding a SQLite of your choosing, SQLCipher, or SQLite3 Multiple Ciphers are described in the installation docs.
Example usage:
from cysqlite import connect
db = connect(':memory:')
db.execute('create table data (k, v)')
with db.atomic():
db.executemany('insert into data (k, v) values (?, ?)',
[(f'k{i:02d}', f'v{i:02d}') for i in range(10)])
print(db.last_insert_rowid()) # 10.
curs = db.execute('select * from data')
for row in curs:
print(row) # e.g., ('k00', 'v00')
# We can use named parameters with a dict as well.
row = db.execute_one('select * from data where k = :key and v = :val',
{'key': 'k05', 'val': 'v05'})
print(row) # ('k05', 'v05')
db.close()
cysqlite lets you extend SQLite with ordinary Python callables. Functions and collations are registered on the connection and automatically restored if it is closed and re-opened:
db.create_function(fn)db.create_aggregate(cls) (step() + finalize())db.create_window_function(cls) (adds inverse() + value())@db.table_function(columns=[...]) over a generatordb.create_collation(fn)Connection hooks observe or veto activity (pass None to clear):
db.commit_hook(fn), db.rollback_hook(fn)db.update_hook(fn) (fires on INSERT, UPDATE or DELETE)db.authorizer(fn)# Scalar function.
db.create_function(str.title, 'title_case')
db.execute('select title_case(?)', ('heLLo wOrLd',)).fetchone() # ('Hello World',)
# Table-valued function from a generator.
@db.table_function(columns=['value'])
def series(start, stop, step=1):
i = start
while i < stop:
yield (i,)
i += step
list(db.execute('select value from series(0, 10, 2)')) # [(0,), (2,), (4,), (6,), (8,)]
See the user-defined functions guide for full examples.
17,254 followers · starred Feb 2026
159 followers · starred Feb 2026
86 followers · starred Feb 2026
python sqlite driver
See the code
cysqlite provides performant bindings to SQLite. cysqlite aims to be roughly
compatible with the behavior of the standard lib sqlite3 module.
cysqlite supports standalone builds or dynamic-linking with the system SQLite.
cysqlite is a Cython-based SQLite driver that provides:

cysqlite can be installed as a pre-built binary wheel with SQLite embedded into the module:
pip install cysqlite
cysqlite can be installed from a source distribution (sdist) which will link against the system SQLite:
# Link against the system sqlite.
pip install --no-binary :all: cysqlite
Self-contained builds embedding a SQLite of your choosing, SQLCipher, or SQLite3 Multiple Ciphers are described in the installation docs.
Example usage:
from cysqlite import connect
db = connect(':memory:')
db.execute('create table data (k, v)')
with db.atomic():
db.executemany('insert into data (k, v) values (?, ?)',
[(f'k{i:02d}', f'v{i:02d}') for i in range(10)])
print(db.last_insert_rowid()) # 10.
curs = db.execute('select * from data')
for row in curs:
print(row) # e.g., ('k00', 'v00')
# We can use named parameters with a dict as well.
row = db.execute_one('select * from data where k = :key and v = :val',
{'key': 'k05', 'val': 'v05'})
print(row) # ('k05', 'v05')
db.close()
cysqlite lets you extend SQLite with ordinary Python callables. Functions and collations are registered on the connection and automatically restored if it is closed and re-opened:
db.create_function(fn)db.create_aggregate(cls) (step() + finalize())db.create_window_function(cls) (adds inverse() + value())@db.table_function(columns=[...]) over a generatordb.create_collation(fn)Connection hooks observe or veto activity (pass None to clear):
db.commit_hook(fn), db.rollback_hook(fn)db.update_hook(fn) (fires on INSERT, UPDATE or DELETE)db.authorizer(fn)# Scalar function.
db.create_function(str.title, 'title_case')
db.execute('select title_case(?)', ('heLLo wOrLd',)).fetchone() # ('Hello World',)
# Table-valued function from a generator.
@db.table_function(columns=['value'])
def series(start, stop, step=1):
i = start
while i < stop:
yield (i,)
i += step
list(db.execute('select value from series(0, 10, 2)')) # [(0,), (2,), (4,), (6,), (8,)]
See the user-defined functions guide for full examples.
17,254 followers · starred Feb 2026
159 followers · starred Feb 2026
86 followers · starred Feb 2026