sqlite-anyio
Asynchronous client for SQLite using AnyIO
What it is and what it does
sqlite-anyio wraps SQLite with an async interface built on AnyIO, allowing you to execute database queries without blocking your event loop. It works with any async framework that AnyIO supports—asyncio, Trio, or others—so you can use the same code across different async runtimes. The package is lightweight, depending only on anyio and typing-extensions, and targets modern Python versions from 3.10 onward.
The main use case is integrating SQLite into async applications where you want to avoid the overhead of thread pools or the complexity of managing blocking I/O. It's particularly useful for small to medium projects that need a simple, embedded database without the operational burden of a separate database server, while still maintaining async/await semantics throughout the application.
Use it for:
- Building async web applications (FastAPI, Starlette) that need a lightweight embedded database.
- Writing async CLI tools or scripts that query SQLite without blocking the event loop.
- Testing async code that requires database fixtures without spinning up a separate database service.
- Prototyping async applications where you want to defer migration to a larger database system.
- Running async background tasks that periodically read or write to a local SQLite database.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an asynchronous client for SQLite that works with any async framework via AnyIO, enabling non-blocking database access without thread pools.
Yes, if you're building an async application and need a simple, embedded database. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. The beta status and small user base mean you should verify that its API and performance meet your specific needs before committing to a large project.
Install
sqlite-anyio on PyPI
pip
pip install sqlite-anyiouv
uv add sqlite-anyiopoetry
poetry add sqlite-anyioInstalling sqlite-anyio
Before you install
Low friction install with only two lightweight runtime dependencies (anyio and typing-extensions). Actively maintained with a recent release, though the project remains in beta status and has a small user base.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
import anyio
from sqlite_anyio import open_sqlite
async def main():
async with open_sqlite(':memory:') as db:
await db.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)')
await db.execute('INSERT INTO test (name) VALUES (?)', ('example',))
rows = await db.execute('SELECT * FROM test')
print(rows.fetchall())
anyio.run(main)
Requires Python 3.10 or later; anyio must be installed as a runtime dependency.
Verify before relying
- Whether the package supports concurrent access patterns or enforces serialization at the connection level.
- Performance characteristics compared to thread-pool-based async SQLite wrappers in real workloads.
- Completeness of SQLite API coverage and any known limitations or missing features.
Package facts
| License | This is the MIT license: http://www.opensource.org/licenses/mit-license.php Copyright (c) Alex Grönholm Permission is hereby granted, free of charge, to any person obtaining a copy of this software… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — anyio, typing-extensions |
| Maintenance | actively maintained — 8 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 625,415/month — #5,696 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sqlite_anyio-0.3.2-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
anysqliteAnysqlite wraps SQLite with an async/await…
unclear · top 5,000 on PyPI
aiosqliteaiosqlite provides an async interface to SQLite…
permissive · top 1,000 on PyPI
anyioAnyIO provides a unified asynchronous API that…
permissive · top 100 on PyPI
factorio-rcon-pyA Python client library for connecting to and…
copyleft · top 15,000 on PyPI
async-extensionsProvides utilities and abstractions built on…
permissive · top 15,000 on PyPI
asyncerAsyncer provides utility functions for working…
permissive · top 5,000 on PyPI
kubernetes-asyncioAsynchronous Python client for the Kubernetes…
permissive · top 5,000 on PyPI
flake8-asyncA flake8 plugin that detects async-related…
permissive · top 15,000 on PyPI
python-socksProvides SOCKS4(a), SOCKS5(h), and HTTP CONNECT…
permissive · top 5,000 on PyPI
libsql-clientPython SDK for connecting to and querying…
permissive · top 15,000 on PyPI