Metadata-Version: 2.5
Name: django-absurd
Version: 1.0.0b1
Summary: Django integration for Absurd, the Postgres-native workflow engine.
Project-URL: Documentation, https://lincolnloop.github.io/django-absurd/
Project-URL: Homepage, https://github.com/lincolnloop/django-absurd
Project-URL: Issues, https://github.com/lincolnloop/django-absurd/issues
Project-URL: Repository, https://github.com/lincolnloop/django-absurd
Author-email: Marc Gibbons <marc@lincolnloop.com>, Lincoln Loop <info@lincolnloop.com>
License-Expression: MIT
License-File: LICENSE
Keywords: absurd,background-jobs,django,postgres,queue,tasks,workflow,workflow-engine
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Distributed Computing
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: absurd-sdk<0.6.0,>=0.5.0
Requires-Dist: croniter>=6.0
Requires-Dist: django>=6.0
Description-Content-Type: text/markdown

# django-absurd

<!-- prettier-ignore-start -->
[![CI](https://github.com/lincolnloop/django-absurd/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/lincolnloop/django-absurd/actions/workflows/test.yml?query=branch%3Amain+event%3Apush)
[![Coverage](https://img.shields.io/codecov/c/github/lincolnloop/django-absurd.svg)](https://codecov.io/gh/lincolnloop/django-absurd)
[![PyPI](https://img.shields.io/pypi/v/django-absurd.svg)](https://pypi.org/project/django-absurd/)
[![Python versions](https://img.shields.io/pypi/pyversions/django-absurd.svg)](https://pypi.org/project/django-absurd/)
[![Django versions](https://img.shields.io/pypi/frameworkversions/django/django-absurd.svg)](https://pypi.org/project/django-absurd/)
[![License](https://img.shields.io/pypi/l/django-absurd.svg)](https://github.com/lincolnloop/django-absurd/blob/main/LICENSE)
<!-- prettier-ignore-end -->

Run background tasks and durable workflows in Django on **Postgres**. Plugs
[Absurd](https://earendil-works.github.io/absurd/), a Postgres-native workflow engine,
into Django's [Tasks](https://docs.djangoproject.com/en/6.0/topics/tasks/) framework,
reusing the database connection your project already has.

> **Beta.** The API is settling ahead of 1.0; behavior may still change.

## Install

```console
uv add django-absurd --prerelease allow    # or: pip install --pre django-absurd
```

Only pre-releases are published before 1.0, hence the flags. Needs Python 3.12+, Django
6.0+, and PostgreSQL on the **psycopg (v3)** driver — Absurd reuses Django's connection,
so psycopg2 won't work.

## Quickstart

```python
# settings.py
INSTALLED_APPS = [
    # ...
    "django_absurd",
]

TASKS = {
    "default": {
        "BACKEND": "django_absurd.backends.AbsurdBackend",
    },
}
```

```console
python manage.py migrate    # installs the Absurd schema, provisions declared queues
```

```python
from django.tasks import task


@task
def add(a: int, b: int) -> int:
    return a + b


result = add.enqueue(2, 3)   # returns a TaskResult; a worker runs it
```

```console
python manage.py absurd_worker
```

That's the whole loop. The `"default"` queue is declared for you, so `migrate`
provisions it without any `QUEUES` setting of your own.

## Documentation

- **[Documentation](https://lincolnloop.github.io/django-absurd/)** — tasks, workflows,
  cron jobs, workers, cleanup, monitoring, testing, and configuration.
- **[Runnable examples](https://github.com/lincolnloop/django-absurd/tree/main/examples)**
  — three dockerized nanodjango demos (`web` enqueue+result, `beat`, and `pg_cron`),
  each with one `docker compose up`.

## License

MIT — see [LICENSE](https://github.com/lincolnloop/django-absurd/blob/main/LICENSE).
