Metadata-Version: 2.5
Name: durablestack
Version: 0.1.0b2
Summary: DurableStack Python runtime
Project-URL: Homepage, https://durablestack.com
Project-URL: Repository, https://github.com/durablestack/durablestack-python
Project-URL: Issues, https://github.com/durablestack/durablestack-python/issues
Author: DurableStack
License: MIT
Keywords: background-workers,distributed-systems,durable-jobs,job-queue,scheduling
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.11
Requires-Dist: asyncpg>=0.30.0
Requires-Dist: croniter>=3.0.3
Requires-Dist: pymysql>=1.1.1
Requires-Dist: pyodbc>=5.1.0
Requires-Dist: tzdata>=2024.1
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == 'dev'
Requires-Dist: mypy>=1.11.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Requires-Dist: twine>=5.1.1; extra == 'dev'
Description-Content-Type: text/markdown

# DurableStack for Python

![DurableStack Logo](https://raw.githubusercontent.com/durablestack/durable-stack/main/durablestack-dotnet/ds-nuget-logo.png)

DurableStack provides reliable background jobs and recurring scheduling for Python applications.

## Install

```bash
pip install durablestack
```

## Quick Start

```python
from datetime import datetime, UTC

from durablestack import create_durable_stack


async def send_email(payload: object) -> None:
    print("sending", payload)


runtime = create_durable_stack()
runtime.register_job("send-email", send_email)

await runtime.start()
run_id = await runtime.enqueue("send-email", {"to": "hello@example.com"})
print("enqueued", run_id)

await runtime.stop()
```

## Providers

- InMemory
- PostgreSQL
- MySQL
- SQL Server
- SQLite

## Runtime Features

- Durable lifecycle with lease-based execution
- Retries with configurable backoff behavior
- Recurring schedules with IANA time zones
- Runtime-control command sync and receipt tracking
- Hosted telemetry ingestion support

## Optional Hosted Eventing / Runtime-Control

When tenant credentials are configured, the runtime can publish telemetry and receive runtime-control commands.

```python
from durablestack.core.options import DurableStackOptions, EventingOptions
from durablestack import create_durable_stack

runtime = create_durable_stack(
    DurableStackOptions(
        eventing=EventingOptions(
            tenant_id="<tenant-id>",
            client_secret="<client-secret>",
            service_name="my-python-worker",
        ),
        include_error_detail_in_events=True,
    )
)
```

## Project Links

- Homepage: https://durablestack.com
- Documentation: https://docs.durablestack.com
- Source: https://github.com/durablestack/durablestack-python
