Fennel is a task queue for Python 3.7+ based on Redis Streams with a Celery-like API.

  • Supports both sync (e.g. Django, Flask) and async (e.g. Starlette, FastAPI) code.

  • Sane defaults: at least once processing semantics, tasks acknowledged on completion.

  • Automatic retries with exponential backoff for fire-and-forget jobs.

  • Clear task statuses available (e.g. sent, executing, success).

  • Automatic task discovery (defaults to using **/

  • Exceptionally small and understandable codebase.


This is an alpha release. The project is under development, breaking changes are likely.


pip install fennel

Basic Usage

Run Redis and then write your code in

from fennel import App

app = App(name='myapp', redis_url='redis://')

def foo(n)
    return n

# Enqueue a task to be executed in the background by a fennel worker process.

Meanwhile, run the worker:

$ python -m fennel worker --app tasks:app

Asynchronous API

Fennel also supports an async API. If your code is running in an event loop (e.g. via Starlette or FastAPI), you will want to use the async interface instead:

from fennel import App

app = App(name='myapp', redis_url='redis://', interface='async')

async def bar(x)
    return x

await bar.delay(5)

Indices and tables