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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c8d133a23ddf263be0f6d8fb890d3960f496039640372ecc8b3d2a961414b78
|
|
| MD5 |
5de098f1fecf97dd680f9c326f4a40f0
|
|
| BLAKE2b-256 |
e4a5ff1f24e8e5661ed2dc5861fc42d345321789531d449e7669c63dbb1c7d27
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0b2c80476cebc1ce8888dbdc3602c7c67e1866673cc174932f0e9a203ae4f99
|
|
| MD5 |
7f8c9c48322ce7760f656b086b2a5b64
|
|
| BLAKE2b-256 |
89634d7497c83cffc348e35b2aacbefc13ed104d6d619d50bfe6c1cef9ea73bd
|