CosmosDB driver for pynosqlc
Project description
pynosqlc-cosmosdb
Azure Cosmos DB driver for pynosqlc — connects to Azure Cosmos DB (or the local emulator) via the azure-cosmos async client.
Install
pip install alt-python-pynosqlc-cosmosdb
Requirements
- Python 3.12+
- azure-cosmos 4.7+
- An Azure Cosmos DB account or the Cosmos DB emulator
Usage
Azure (production)
Pass the account endpoint in the URL and the account key in the properties dict:
import asyncio
from pynosqlc.core import DriverManager, Filter
import pynosqlc.cosmosdb # auto-registers CosmosDriver
async def main():
async with await DriverManager.get_client(
'pynosqlc:cosmosdb:https://myaccount.documents.azure.com:443/',
properties={'key': '<your-account-key>', 'db_id': 'mydb'},
) as client:
col = client.get_collection('orders')
await col.store('o1', {'item': 'widget', 'qty': 5})
f = Filter.where('qty').gt(0).build()
async for doc in await col.find(f):
print(doc)
asyncio.run(main())
Cosmos DB Emulator (local)
Use local as the target — the driver connects to http://localhost:8081 with
the well-known emulator master key automatically:
async with await DriverManager.get_client(
'pynosqlc:cosmosdb:local',
properties={'db_id': 'mydb'},
) as client:
...
URL scheme
pynosqlc:cosmosdb:<endpoint-or-local>
| Target | Resolves to |
|---|---|
local or localhost |
http://localhost:8081 with emulator master key |
localhost:PORT |
http://localhost:PORT with emulator master key |
https://... |
Azure Cosmos DB account endpoint (requires key property) |
Optional properties:
| Key | Description |
|---|---|
key |
Account key (required for https:// targets; omitted for emulator) |
db_id |
Database name (default: 'pynosqlc') |
endpoint |
Override endpoint URL (for local/localhost targets) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alt_python_pynosqlc_cosmosdb-1.0.2.tar.gz.
File metadata
- Download URL: alt_python_pynosqlc_cosmosdb-1.0.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
819b45aa9585f5d29f23739798651572e92494abc6329d9c22409737b9e7833b
|
|
| MD5 |
82b95deac7ea3263d2580de04bdc00d9
|
|
| BLAKE2b-256 |
c741f6af371b67d443c3cdfaaed121a7a6c6cece84452d5a943b2ddd635e4d22
|
File details
Details for the file alt_python_pynosqlc_cosmosdb-1.0.2-py3-none-any.whl.
File metadata
- Download URL: alt_python_pynosqlc_cosmosdb-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f35fe67216fea1cd8e95d90686e2ca344990fefa413be21231a6315bb93212
|
|
| MD5 |
fa29abea7b836414edca89d0ad836582
|
|
| BLAKE2b-256 |
573d250eb63327a11fce84026f0fe9d7301f3eaf2e933951053039ff79ce922a
|