Skip to content

Commit dcdde57

Browse files
feat: Add Azure Cosmos DB store implementation
Add CosmosDBStore for Azure Cosmos DB NoSQL API support: - Implements AsyncKeyValue protocol with full CRUD operations - Uses partition key for collection isolation - Supports TTL via Cosmos DB's native TTL feature - Includes collection sanitization strategy - Supports both client injection and URL/credential configuration - Adds optional dependency: azure-cosmos>=4.7.0 Closes #292 Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
1 parent 7fe04c8 commit dcdde57

6 files changed

Lines changed: 724 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ rocksdb = [
5151
duckdb = ["duckdb>=1.1.1", "pytz>=2025.2"]
5252
postgresql = ["asyncpg>=0.30.0"]
5353
firestore = ["google-cloud-firestore>=2.13.0", "google-auth>=2.24.0"]
54+
cosmosdb = ["azure-cosmos>=4.7.0"]
5455
wrappers-encryption = ["cryptography>=45.0.0"]
5556
docs = [
5657
"mkdocs>=1.6.0",
@@ -61,7 +62,7 @@ docs = [
6162

6263
[dependency-groups]
6364
dev = [
64-
"py-key-value-aio[memory,disk,filetree,redis,elasticsearch,opensearch,memcached,mongodb,vault,dynamodb,s3,rocksdb,duckdb,firestore,postgresql]",
65+
"py-key-value-aio[memory,disk,filetree,redis,elasticsearch,opensearch,memcached,mongodb,vault,dynamodb,s3,rocksdb,duckdb,firestore,postgresql,cosmosdb]",
6566
"py-key-value-aio[valkey]; platform_system != 'Windows'",
6667
"py-key-value-aio[aerospike]; platform_system != 'Windows'",
6768
"py-key-value-aio[keyring]",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from key_value.aio.stores.cosmosdb.store import CosmosDBStore
2+
3+
__all__ = ["CosmosDBStore"]

0 commit comments

Comments
 (0)