Skip to main content

cozycosmos

A small convenience wrapper for Azure Cosmos DB CRUD operations.

Installation

pip install cozycosmos

For local development from this repository:

python -m pip install -e .

Usage

Set your Cosmos DB credentials:

export COSMOS_URL="https://your-account.documents.azure.com:443/"
export COSMOS_KEY="your-cosmos-key"

Use the package:

from cozycosmos import CosmosStore

store = CosmosStore(
    database_name="prototype-db",
    container_name="documents",
    partition_key_path="/partitionKey",
)

item = store.write(
    {
        "id": "1",
        "partitionKey": "default",
        "name": "name1",
        "city": "Christchurch",
    }
)

print(item)

Command Line

After installing the package, use the cozycosmos command:

ezcosmos \
  --database prototype-db \
  --container documents \
  read 1

You can also pass credentials directly instead of using COSMOS_URL and COSMOS_KEY:

ezcosmos \
  --url "https://your-account.documents.azure.com:443/" \
  --key "your-cosmos-key" \
  --database prototype-db \
  --container documents \
  write '{"id": "1", "partitionKey": "default", "name": "name1"}'

You can also run the sample in examples/basic_usage.py:

python examples/basic_usage.py

Build

Install build tooling:

python -m pip install build twine

Build the package:

python -m build

Check the package metadata:

python -m twine check dist/*

Upload to TestPyPI:

python -m twine upload --repository testpypi dist/*

Upload to PyPI:

python -m twine upload dist/*

Metadata

Release files for cozycosmos 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cozycosmos 0.1.1
File Size Uploaded Provenance Actions
cozycosmos-0.1.1.tar.gz 3.6 kB Without provenance Details for cozycosmos-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cozycosmos 0.1.1
File Interpreter ABI Platform Actions
cozycosmos-0.1.1-py3-none-any.whl Python 3 none any Details for cozycosmos-0.1.1-py3-none-any.whl

Total release size: 7.9 kB

Release files / cozycosmos-0.1.1.tar.gz

Download URL cozycosmos-0.1.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d062624631730f9fa420668b4f0f53c790a945f882bb649a24b11fa24f81ecc9
BLAKE2b-256 checksum
How to use checksums
e0476fd80ef89972bc2bf5862e59381d5c1baed2571b4b6644ffea373457790f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / cozycosmos-0.1.1-py3-none-any.whl

Download URL cozycosmos-0.1.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17f7b803de3ce65d833e033508c267f6fd3a17122142c6c3e7b1fd435cf3b034
BLAKE2b-256 checksum
How to use checksums
3ccd6e5bd8ac207dd039b2c062fbb3674b8406471ba293b4e5ae0c222fb081f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for cozycosmos 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page