Metadata-Version: 2.4
Name: edgecron-python
Version: 1.0.0
Summary: Official Python SDK for the EdgeCron webhook scheduling and callback delivery platform.
Project-URL: Homepage, https://github.com/edgecron/edgecron-python
Project-URL: Repository, https://github.com/edgecron/edgecron-python
Project-URL: Documentation, https://www.edgecron.com
Author: EdgeCron Team
License: MIT
License-File: LICENSE
Keywords: callback,delivery,edgecron,scheduling,webhook
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: requests<3,>=2.31.0
Provides-Extra: test
Requires-Dist: pytest<9,>=8; extra == 'test'
Description-Content-Type: text/markdown

# EdgeCron Python SDK

Official Python SDK for the EdgeCron webhook scheduling and callback delivery platform.

Schedule delayed HTTP requests, deliver webhooks reliably, and automatically retry failed calls — with full execution history so nothing gets lost.

中文文档：[README.zh-CN.md](README.zh-CN.md)

## Install

```bash
pip install edgecron-python
```

## Quick Start

```python
from edgecron import EdgeCron, APIError
from edgecron.types import CreateScheduleRequest

client = EdgeCron("ak_xxx", "sk_xxx")

try:
    schedule = client.schedules.create(
        CreateScheduleRequest(
            name="my-schedule",
            cron_expr="*/5 * * * *",
        )
    )
    print(schedule.id)
except APIError as exc:
    print(exc.code, exc.message, exc.request_id)
```

## Modules

| Client method              | Description                      |
|----------------------------|----------------------------------|
| `client.schedules.*`       | Cron schedule CRUD, pause, resume |
| `client.tasks.*`           | Task execution instances, cancel  |
| `client.events.*`          | Event publishing and management   |
| `client.endpoints.*`       | Webhook endpoint configuration    |
| `client.deliveries.*`      | Delivery attempt records and retry |
| `client.retries.*`         | Retry policies and jobs           |
| `client.subscription.*`    | Quota, usage, and resource limits |

## Configuration

- `base_url` — override API base URL
- `timeout` — HTTP client timeout in seconds
- `session` — custom `requests.Session`

## Error Handling

Service-side business errors raise `APIError`.

```python
from edgecron import APIError

try:
    client.schedules.get(123)
except APIError as exc:
    print(exc.code, exc.message, exc.request_id)
```

## Security Notice

This is a server-side SDK. Never expose `secret` in browsers, mobile apps, or other untrusted clients.
