Metadata-Version: 2.4
Name: mongo-keepalive
Version: 1.0.0
Summary: Keep MongoDB Atlas free-tier clusters alive by sending periodic ping commands
License: MIT
Project-URL: Homepage, https://github.com/YadavSourabhGH/mongo-keepalive
Project-URL: Repository, https://github.com/YadavSourabhGH/mongo-keepalive
Keywords: mongodb,atlas,keepalive,ping,free-tier
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pymongo>=4.0.0

# mongo-keepalive (Python)

Keep MongoDB Atlas free-tier clusters alive by sending periodic `ping` commands.

## Installation

```bash
pip install mongo-keepalive
```

## Usage

```python
from mongo_keepalive import start_keep_alive

handle = start_keep_alive(
    uri="mongodb+srv://user:pass@cluster.mongodb.net/db",
    interval="12h",  # optional, defaults to "12h"
)

# To stop later:
# handle.stop()
```

## API

### `start_keep_alive(uri, interval="12h")`

| Parameter  | Type | Default | Description                          |
| ---------- | ---- | ------- | ------------------------------------ |
| `uri`      | str  | —       | MongoDB connection string (required) |
| `interval` | str  | `"12h"` | Ping interval (`"12h"`, `"30m"`, `"60s"`) |

Returns a handle with a `stop()` method.

## License

MIT
