py-key-value-aio
Async Key-Value Store - A pluggable interface for KV Stores
Decision gist · record as of 2026-08-14
Yes, if you need a backend-agnostic async key-value abstraction and are comfortable with async-only code. The low install friction, active maintenance, and permissive license make it a solid choice for frameworks or applications that benefit from pluggable storage. Alpha status means the API may shift, so pin versions carefully. Not suitable if you need synchronous operations or prefer to couple directly to a specific backend.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Async/await patterns are mandatory; no synchronous API is planned.
- Low install friction with only two runtime dependencies (beartype and typing-extensions).
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
last release 2026-05-27 (79 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 90,300,577 downloads/mo, #374 on PyPI
Alternatives
Verify before relying
pip install py-key-value-aio
import asyncio
from py_key_value_aio.stores.memory import MemoryStore
async def main():
store = MemoryStore()
await store.put(key="user:1", value={"name": "Alice"}, ttl=3600)
result = await store.get(key="user:1")
await store.delete(key="user:1")
asyncio.run(main())- Exact number and stability of each backend store implementation.
- Performance characteristics and latency profiles across different store types.
- Serialization format and compatibility guarantees for stored values.
- Scope and impact of beartype runtime type checking on performance.
What it is and what it does
py-key-value-aio is an async-only key-value store library that abstracts away the choice of backend storage. Instead of coupling your code to a single store, you code against a protocol with simple get, put, delete, and TTL operations. The library ships with implementations for many backends: in-memory, disk-based, RocksDB, Redis, Valkey, DynamoDB, S3, Azure Tables, MongoDB, Elasticsearch, Firestore, and others. Values are wrapped in managed entries and include metadata like creation timestamp and TTL; they are always deserialized on retrieval, never returned as live objects.
The design is especially valuable for framework authors: by accepting the protocol in your framework's initialization, you let users swap storage backends without touching your code. Development can use MemoryStore for speed, production can use RedisStore or DynamoDB, and testing can use NullStore—all without framework changes. Runtime type checking via beartype enforces protocol compliance on core operations, raising TypeError on violations; other code produces warnings that can be suppressed or disabled via environment variable.
Use it for
- Framework authors building caching or session middleware that users can configure with any backend.
- Applications needing to switch between local storage for development and distributed storage for production.
- Microservices requiring a consistent key-value interface across heterogeneous storage backends.
- Building response caching or token persistence layers with automatic expiration.
- Testing code that uses key-value stores by injecting a test store without side effects.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a backend-agnostic async key-value abstraction and are comfortable with async-only code.
The low install friction, active maintenance, and permissive license make it a solid choice for frameworks or applications that benefit from pluggable storage. Alpha status means the API may shift, so pin versions carefully. Not suitable if you need synchronous operations or prefer to couple directly to a specific backend.
Install
py-key-value-aio on PyPI
Before you install
Low install friction with only two runtime dependencies (beartype and typing-extensions). Active maintenance with a recent release. Alpha status signals the API may change, but targets modern Python versions (3.10+).
Requires Python 3.10 or later. Async/await patterns are mandatory; no synchronous API is planned.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install py-key-value-aio
import asyncio
from py_key_value_aio.stores.memory import MemoryStore
async def main():
store = MemoryStore()
await store.put(key="user:1", value={"name": "Alice"}, ttl=3600)
result = await store.get(key="user:1")
await store.delete(key="user:1")
asyncio.run(main())
Verify before relying
- Exact number and stability of each backend store implementation.
- Performance characteristics and latency profiles across different store types.
- Serialization format and compatibility guarantees for stored values.
- Scope and impact of beartype runtime type checking on performance.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesbeartypetyping-extensions |
| Maintenance | Actively maintained 79 days since the last release |
| First released | |
| Downloads | 90,300,577 / month, #374 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13 |
Evidence: py_key_value_aio-0.4.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “async key-value store”
- py-key-value-aioProvides an async-only, pluggable key-value store abstraction with…
- valkeyPython client library for connecting to and executing commands…
- redisPython client library for connecting to and executing commands…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also simplekv · py-key-value-shared · valkey · aiohttp-client-cache · aiocache · aiomoto · cachelib · aiohttp-session · aioboto3 · django-valkey