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.4.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.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alt_python_pynosqlc_cosmosdb-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 4051b90cfd7e63c2019c356e03cd882b49cd52dbe2248b714ea784e7adc4165b
MD5 b6c4f72454e4504fff3c38c77faf5d64
BLAKE2b-256 746f5ba5a0dc66a69ea8aac8675e770c436112e0a3403436a0889cd87c6d9510

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alt_python_pynosqlc_cosmosdb-1.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 92028aafd225d202430a8c37cd245553e07733c55d3131c02e3b8a5f1fa832e8
MD5 da619e44ea2e292223e747955a43258d
BLAKE2b-256 6f8a4d4ae1beecc247c1dc397a76b0fd91c38290d10f20afd12de5d018858b22

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