Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alt_python_pynosqlc_cosmosdb-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alt_python_pynosqlc_cosmosdb-1.0.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file alt_python_pynosqlc_cosmosdb-1.0.0.tar.gz.

File metadata

  • Download URL: alt_python_pynosqlc_cosmosdb-1.0.0.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

Hashes for alt_python_pynosqlc_cosmosdb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b7f4d5254370ca6fd5257dba8b034959711d307689eb70bab9749b488bfb4886
MD5 8c6912ccacf83379215e621d45ccccc3
BLAKE2b-256 2aa6267b18385a48b1a69f468e39cea78f473d63bb20469d51b00f99401c8892

See more details on using hashes here.

File details

Details for the file alt_python_pynosqlc_cosmosdb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: alt_python_pynosqlc_cosmosdb-1.0.0-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

Hashes for alt_python_pynosqlc_cosmosdb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e364b0ea582e1877ea22563a23953f55fe26fa03039ab7a8433876e2a0b275f
MD5 f8795e37a9a133587ffc23e738ec1806
BLAKE2b-256 b2fffb687d3f3245462cbeefec33eb17b49c542714835d4f1f5ad8a699094933

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page