skillfed

sqlite-anyio

Asynchronous client for SQLite using AnyIO

sqlite-anyio v0.3.2 625.4K downloads/30d#5,696 on PyPI6
Permissive 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) Active released

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-anyio

uv

uv add sqlite-anyio

poetry

poetry add sqlite-anyio

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DatabaseTyping :: Typed

Tags

async sqlite clientasyncio sqlite databaseanyio sqlite wrappernon-blocking sqliteasync database access
async-iosqlite

More Database packages