ezcosmos
A small convenience wrapper for Azure Cosmos DB CRUD operations.
Installation
pip install ezcosmos
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 ezcosmos import CosmosStore
store = CosmosStore(
database_name="prototype-db",
container_name="documents",
partition_key_path="/partitionKey",
)
item = store.write(
{
"id": "1",
"partitionKey": "default",
"name": "Junbum",
"city": "Christchurch",
}
)
print(item)
Command Line
After installing the package, use the ezcosmos 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": "Junbum"}'
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 ezcosmos 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezcosmos-0.1.0.tar.gz | 3.6 kB | Without provenance | Details for ezcosmos-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezcosmos-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ezcosmos-0.1.0-py3-none-any.whl |
Total release size: 7.8 kB
Release files / ezcosmos-0.1.0.tar.gz
| Download URL | ezcosmos-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
472245f941ce2a6305923b6413ee20e8340017fdfbb5b1f6e416e7caa4965928
|
|
BLAKE2b-256 checksum How to use checksums |
dd87ba7b80883da559a6712dd3c50c518232832aea8237885d44f278cc28a8c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / ezcosmos-0.1.0-py3-none-any.whl
| Download URL | ezcosmos-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
966b65bcf8e7eaea4b3603c00bfaef0fc7e146fbf03eb3a138e1cb17675659cc
|
|
BLAKE2b-256 checksum How to use checksums |
3ef93a9e5123ac15b8755b9ca986709aeeb4b1e04badd292109fd7386070bb6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for ezcosmos 0.1.0
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.