Metadata-Version: 2.4
Name: cosmos-bulk
Version: 0.1.2
Summary: Azure Cosmos DB bulk delete utility for asynchronous bulk document deletion.
Author-email: Surender Elangovan & Krishnakumar S <esurender99@gmail.com>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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

```bash
pip install cosmos-bulk
```

## Requirements

- Python 3.10+
- Azure Cosmos DB account

## Usage

```python
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()

```python
delete(query, partition_key_field, concurrency=10)
```

Returns

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

## License

MIT

## Authors

- Surender Elangovan
- Krishnakumar S
