apsw
Another Python SQLite Wrapper
What it is and what it does
APSW is a complete Python binding to SQLite's C API, designed for developers who want to use SQLite's full feature set rather than just basic SQL operations. Unlike the standard library's sqlite3 module, APSW exposes advanced capabilities including full-text search, virtual tables, custom virtual file systems (VFS), JSON operations, and CArray support. It stays synchronized with both SQLite and Python releases.
The package supports both synchronous code and async frameworks (AsyncIO, Trio, AnyIO). It has no runtime dependencies and is distributed as prebuilt wheels for CPython 3.10+ across multiple architectures. The project is actively maintained, with a recent release and an engaged community. The trade-off is that it requires a C compiler if building from source, though wheels eliminate this for most users.
Use it for:
- Building applications that need SQLite's full-text search or JSON query capabilities beyond standard SQL.
- Implementing custom virtual tables or file system layers for specialized data access patterns.
- Writing async database code that integrates with AsyncIO, Trio, or other async frameworks.
- Replacing sqlite3 when you need lower-level control over SQLite's C API or want to stay current with SQLite releases.
- Developing embedded database features in Python applications where SQLite's advanced features are required.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
APSW is a Python wrapper around SQLite's complete C API, providing access to advanced SQLite features like full-text search, virtual tables, VFS, JSON support, and async framework integration.
Yes, if you need SQLite's advanced features (full-text search, virtual tables, VFS, JSON) or want tighter control over the C API. The active maintenance, wide platform support via prebuilt wheels, and zero runtime dependencies make it a solid choice. The unclear license treatment warrants a quick check before use in proprietary projects. If you only need basic SQL operations, the standard library sqlite3 module is simpler.
Install
apsw on PyPI
pip
pip install apswuv
uv add apswpoetry
poetry add apswInstalling apsw
Before you install
Medium install friction due to compiled C extension; however, prebuilt wheels are available for CPython 3.10+ across major platforms (macOS, Linux, Windows, ARM variants), and the project is actively maintained with a recent release.
License in practice
License treatment is unclear—the package states it uses 'any OSI approved open source license' but provides no specific SPDX identifier. Verify the actual license terms in the repository before adopting in proprietary or restricted-license contexts.
Quickstart
import apsw
conn = apsw.Connection(':memory:')
cursor = conn.cursor()
cursor.execute('CREATE TABLE test (id INTEGER, name TEXT)')
cursor.execute('INSERT INTO test VALUES (1, "example")')
for row in cursor.execute('SELECT * FROM test'):
print(row)
Requires CPython 3.10 or later; compiled extension requires a C compiler if building from source (prebuilt wheels available for common platforms).
Verify before relying
- Whether the 'any OSI approved open source license' phrasing means the license is user-selectable or if a specific license applies.
- Performance characteristics compared to the standard library sqlite3 module for typical workloads.
- Stability and compatibility guarantees for async framework support across different Python async libraries.
Package facts
| License | any-OSI (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 19 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,577,945/month — #2,993 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: apsw-3.53.4.0-cp310-cp310-macosx_10_9_x86_64.whl; apsw-3.53.4.0-cp310-cp310-macosx_11_0_arm64.whl; apsw-3.53.4.0-cp310-cp310-manylinux_2_28_aarch64.whl; apsw-3.53.4.0-cp310-cp310-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl; apsw-3.53.4.0-cp310-cp310-manylinux_2_28_i686.whl; apsw-3.53.4.0-cp310-cp310-manylinux_2_28_x86_64.whl; apsw-3.53.4.0-cp310-cp310-musllinux_1_2_aarch64.whl; apsw-3.53.4.0-cp310-cp310-musllinux_1_2_armv7l.whl; apsw-3.53.4.0-cp310-cp310-musllinux_1_2_i686.whl; apsw-3.53.4.0-cp310-cp310-musllinux_1_2_x86_64.whl; apsw-3.53.4.0-cp310-cp310-win32.whl; apsw-3.53.4.0-cp310-cp310-win_amd64.whl; apsw-3.53.4.0-cp310-cp310-win_arm64.whl; apsw-3.53.4.0-cp311-cp311-macosx_10_9_x86_64.whl; apsw-3.53.4.0-cp311-cp311-macosx_11_0_arm64.whl; apsw-3.53.4.0-cp311-cp311-manylinux_2_28_aarch64.whl; apsw-3.53.4.0-cp311-cp311-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl; apsw-3.53.4.0-cp311-cp311-manylinux_2_28_i686.whl; apsw-3.53.4.0-cp311-cp311-manylinux_2_28_x86_64.whl; apsw-3.53.4.0-cp311-cp311-musllinux_1_2_aarch64.whl
Keywords: database, sqlite
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
apswutilsProvides a Python interface for SQLite…
permissive · top 15,000 on PyPI
anysqliteAnysqlite wraps SQLite with an async/await…
unclear · top 5,000 on PyPI
sqlite-utilsCLI tool and Python library for creating,…
permissive · top 5,000 on PyPI
aiosqlLoad SQL queries from files and call them as…
permissive · top 15,000 on PyPI
sqlitedictProvides a dict-like interface to SQLite…
permissive · top 5,000 on PyPI
pysqlite3-binaryProvides a self-contained SQLite database…
permissive · top 5,000 on PyPI
pysqlite3pysqlite3 packages SQLite as a standalone…
permissive · top 15,000 on PyPI
sqlite-anyioProvides an asynchronous client for SQLite that…
permissive · top 15,000 on PyPI
aiosqliteaiosqlite provides an async interface to SQLite…
permissive · top 1,000 on PyPI
sqlalchemy-adapterBridges PyCasbin access-control policies with…
permissive · top 5,000 on PyPI