Metadata-Version: 2.4
Name: localqueue
Version: 0.3.3
Summary: Durable local queues for Python, with persistent retry state powered by Tenacity.
Project-URL: Homepage, https://brunoportis.github.io/localqueue/
Project-URL: Documentation, https://brunoportis.github.io/localqueue/
Project-URL: Repository, https://github.com/brunoportis/localqueue
Project-URL: Issues, https://github.com/brunoportis/localqueue/issues
Author: Bruno Portis
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
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 :: Python Modules
Requires-Python: >=3.11
Requires-Dist: tenacity>=9.1.4
Provides-Extra: all
Requires-Dist: lmdb>=2.2.0; extra == 'all'
Requires-Dist: pyyaml>=6.0.3; extra == 'all'
Requires-Dist: rich>=15.0.0; extra == 'all'
Requires-Dist: typer>=0.16.0; extra == 'all'
Provides-Extra: cli
Requires-Dist: pyyaml>=6.0.3; extra == 'cli'
Requires-Dist: rich>=15.0.0; extra == 'cli'
Requires-Dist: typer>=0.16.0; extra == 'cli'
Provides-Extra: lmdb
Requires-Dist: lmdb>=2.2.0; extra == 'lmdb'
Provides-Extra: sqlite
Description-Content-Type: text/markdown

# `localqueue`

[![Tests](https://github.com/brunoportis/localqueue/actions/workflows/tests.yml/badge.svg)](https://github.com/brunoportis/localqueue/actions/workflows/tests.yml)
[![CodeQL](https://github.com/brunoportis/localqueue/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/brunoportis/localqueue/actions/workflows/github-code-scanning/codeql)
[![PyPI version](https://img.shields.io/pypi/v/localqueue.svg)](https://pypi.org/project/localqueue/)
![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)

`localqueue` is a small durable queue for one machine. It stores work on the local filesystem by default and keeps retry state with Tenacity.

Use it for scripts, CLI tools, cron jobs, and small Python workers that share one local store. Use `localqueue.retry` when another system already delivers work and you only need retry state that survives restarts.

```bash
localqueue queue exec emails -- python scripts/send_email.py
```

```python
from localqueue import PersistentQueue, persistent_worker

queue = PersistentQueue("emails")
queue.put({"to": "user@example.com"})

@persistent_worker(queue)
def send_email(job: dict[str, str]) -> None:
    deliver(job["to"])
```

Full docs live at [brunoportis.github.io/localqueue](https://brunoportis.github.io/localqueue/). The source docs are in [`docs/`](docs/).

## Install

```bash
pip install localqueue
```

For the CLI:

```bash
pip install "localqueue[cli]"
```

For the optional LMDB backend:

```bash
pip install "localqueue[lmdb]"
```

## Running with Docker

The image is also published on GitHub Container Registry:

```bash
docker pull ghcr.io/brunoportis/localqueue:latest
docker run --rm ghcr.io/brunoportis/localqueue:latest --help
```

## When not to use

`localqueue` is not a distributed broker. If you need multi-host coordination, high write concurrency, managed retention, or strict cross-service ordering, use a system designed for that operating model.
