API Reference¶
Complete API reference documentation for py-key-value.
Overview¶
The py-key-value API is organized into four main components:
- Protocols - Core interfaces for the key-value store
- Stores - Backend implementations for different storage systems
- Wrappers - Decorators that add functionality to stores
- Adapters - Utilities that simplify working with stores
Quick Links¶
Core Protocols¶
The AsyncKeyValue protocol defines the async interface that all
stores implement.
The KeyValue protocol is the synchronous version.
Popular Stores¶
- MemoryStore - In-memory storage
- RedisStore - Redis backend
- DiskStore - File-based storage
Common Wrappers¶
- LoggingWrapper - Add logging to any store
- CacheWrapper - Add caching layer
- RetryWrapper - Add automatic retry logic
Using the API Reference¶
Each page provides:
- Type signatures - Full type information for all parameters and return values
- Docstrings - Detailed descriptions of functionality
- Source links - View the implementation on GitHub
- Cross-references - Navigate between related components
Example Usage¶
from key_value.aio.stores.memory import MemoryStore
from key_value.aio.wrappers.logging import LoggingWrapper
# Create a store with logging
store = LoggingWrapper(MemoryStore())
# Use the store
await store.put("key", "value")
result = await store.get("key")
For more examples and guides, see the User Guide.