Skip to main content

Azure Cosmos DB bulk delete utility for asynchronous bulk document deletion.

Project description

cosmos-bulk

Azure Cosmos DB Bulk Delete Utility for Python.

cosmos-bulk simplifies bulk deletion of Azure Cosmos DB documents using asynchronous operations and configurable concurrency.

Features

  • Bulk delete documents using a SQL query
  • Async implementation
  • Configurable concurrency
  • Simple API
  • Built on the official Azure Cosmos Python SDK

Installation

pip install cosmos-bulk

Requirements

  • Python 3.10+
  • Azure Cosmos DB account

Usage

from cosmos_bulk import CosmosBulk

bulk = CosmosBulk(
    endpoint="ENDPOINT",
    key="KEY",
    database="mcpd",
    container="events"
)

result = bulk.delete(
    query="SELECT c.id, c.customerId FROM c",
    partition_key_field="customerId",
    concurrency=20
)

print(result)

Parameters

Parameter Description
endpoint Cosmos DB endpoint
key Cosmos DB access key
database Database name
container Container name

delete()

delete(query, partition_key_field, concurrency=10)

Returns

{
    "deleted": 100,
    "failed": 0
}

License

MIT

Authors

  • Surender Elangovan
  • Krishnakumar S

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

cosmos_bulk-0.1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

cosmos_bulk-0.1.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file cosmos_bulk-0.1.2.tar.gz.

File metadata

  • Download URL: cosmos_bulk-0.1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for cosmos_bulk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7c8d133a23ddf263be0f6d8fb890d3960f496039640372ecc8b3d2a961414b78
MD5 5de098f1fecf97dd680f9c326f4a40f0
BLAKE2b-256 e4a5ff1f24e8e5661ed2dc5861fc42d345321789531d449e7669c63dbb1c7d27

See more details on using hashes here.

File details

Details for the file cosmos_bulk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cosmos_bulk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for cosmos_bulk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b2c80476cebc1ce8888dbdc3602c7c67e1866673cc174932f0e9a203ae4f99
MD5 7f8c9c48322ce7760f656b086b2a5b64
BLAKE2b-256 89634d7497c83cffc348e35b2aacbefc13ed104d6d619d50bfe6c1cef9ea73bd

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