Skip to content

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

Core Protocols

The AsyncKeyValue protocol defines the async interface that all stores implement.

The KeyValue protocol is the synchronous version.

Common Wrappers

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.