skillfed

apsw

Another Python SQLite Wrapper

apsw v3.53.4.0 2.6M downloads/30d#2,993 on PyPI847
License unclear any-OSI Active released

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 apsw

uv

uv add apsw

poetry

poetry add apsw

Installing 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

Development Status :: 5 - Production/StableFramework :: AnyIOFramework :: AsyncIOFramework :: TrioIntended Audience :: DevelopersProgramming Language :: CProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Database :: Front-EndsTyping :: Typed

Tags

sqlite wrapper pythonsqlite full text searchsqlite virtual tablessqlite async pythonsqlite c api bindingssqlite vfs pythonsqlite json support
sqlite-bindingasync-supportc-extension

More Front-Ends packages