turbolite
Compressed SQLite for Python. Transparent zstd compression via a custom VFS — works with the standard sqlite3 module.
Install
pip install turbolite
Usage
import turbolite
# File-first: /data/app.db is the local page image (turbolite-owned).
# /data/app.db-turbolite/ holds hidden implementation state
# (manifest, cache, staging logs).
conn = turbolite.connect("/data/app.db")
conn.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)")
conn.execute("INSERT INTO users VALUES (1, 'alice')")
conn.commit()
rows = conn.execute("SELECT * FROM users").fetchall()
print(rows) # [(1, 'alice')]
conn.close()
app.db is turbolite's compressed page image. It is not promised to be
opened directly by stock sqlite3. To produce a normal SQLite file the
standard sqlite3 CLI can read, use iterdump:
src = turbolite.connect("/data/app.db")
dst = sqlite3.connect("/data/exported.sqlite")
dst.executescript("\n".join(src.iterdump()))
dst.close()
src.close()
Lower-level entry point
If you need direct access to the SQLite extension (e.g. to register
multiple per-tenant VFSes from a single connection), call
turbolite.load(conn) and use the turbolite_register_file_first_vfs(name, db_path) SQL function yourself. The bare cache_dir-based
turbolite_register_vfs(name, cache_dir) is still available for embedders
who want to manage the cache layout directly, but new code should use
turbolite.connect() or the file-first SQL function.
SQL functions
The extension registers helper SQL functions:
conn.execute("SELECT turbolite_version()").fetchone()
# ('0.1.0',)
How it works
turbolite.load(conn) loads a platform-specific SQLite loadable extension (.so/.dylib) bundled inside the Python package. The extension registers a custom VFS named "turbolite" that transparently compresses pages with zstd.
Your existing sqlite3 code works unchanged — just open with ?vfs=turbolite in a URI connection string.
Build from source
# Build the loadable extension
cd ../..
make ext
# Copy into the package
cp target/release/turbolite.dylib packages/python/turbolite/
# or on Linux: cp target/release/turbolite.so packages/python/turbolite/
# Install in development mode
cd packages/python
pip install -e .
Metadata
Release files for turbolite 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| turbolite-0.5.0.tar.gz | 7.4 MB | Without provenance | Details for turbolite-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| turbolite-0.5.0-py3-none-macosx_11_0_universal2.whl | Python 3 | none | macOS 11.0+ universal2 (ARM64, x86-64) | Details for turbolite-0.5.0-py3-none-macosx_11_0_universal2.whl |
Total release size: 14.9 MB
Release files / turbolite-0.5.0.tar.gz
| Download URL | turbolite-0.5.0.tar.gz |
|---|---|
| Size | 7.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8fb34896ad0791b4d846377246dc78674d7b761cd6ba7a92ca4d8f316ea997d
|
|
BLAKE2b-256 checksum How to use checksums |
dc4387682e8ef39905a286803f0416dc8edaf7ec3f3263c91c2cd3c737e4cc75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / turbolite-0.5.0-py3-none-macosx_11_0_universal2.whl
| Download URL | turbolite-0.5.0-py3-none-macosx_11_0_universal2.whl |
|---|---|
| Size | 7.5 MB |
| Tags | Python 3 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
c5ef9fa7711b63a3c0ccff1e82acfab55f082fb09040b79824590e138c9844ef
|
|
BLAKE2b-256 checksum How to use checksums |
1d81054bcf6f94f7f3f42d7750939cdeb476e8d7af91c9b640b33ef2dc556834
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for turbolite 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.