Azure Blob KV
The BlobKV
stores items as blobs in an Azure Blob Storage service. You can also use BlobContainerKV
to store items in a specific container.
Example
from kv import KV, BlobKV, BlobContainerKV
blob = KV.of('azure+blob://<connection string>', type=dict)
# BlobKV
container = KV.of('azure+blob://<connection string>?container=user1')
# BlobContainerKV
await blob.insert('key1', {'value': 1})
await container.insert('nested/key2', {'value': 2})
await container.insert('key3', {'value': 3})
This will yield:
Datatypes
str|bytes
: written as-isdict|list|dataclass|etc
: validated as JSON usingpydantic
Prefixing
Prefixing a BlobKV
a single level yields a BlobContainerKV
. Further nesting falls back to prefixing blob names.