Skip to main content

Celery broker + result backend powered by ZeroDB. Replace Redis/RabbitMQ with one line — zero infrastructure, auto-provisioned.

Project description

zerodb-celery

Celery broker + result backend powered by ZeroDB. Replace Redis/RabbitMQ with one line.

PyPI License: MIT

Why?

Celery requires Redis or RabbitMQ for its broker and result backend. That means provisioning, configuring, and paying for infrastructure you shouldn't need.

zerodb-celery replaces both with ZeroDB — a cloud database that auto-provisions on first use. No signup, no credit card, no infrastructure.

Install

pip install zerodb-celery

Quick Start

from celery import Celery
from zerodb_celery import ZeroDBBroker, ZeroDBBackend

app = Celery('tasks')

# Configure both broker and backend
ZeroDBBroker.configure(app)
ZeroDBBackend.configure(app)

@app.task
def add(x, y):
    return x + y

# Trigger a task
result = add.delay(4, 6)
print(result.get(timeout=30))  # 10

Configuration

Auto-provisioning (default)

Just use zerodb://auto — a free ZeroDB project is created on first use:

app.config_from_object({
    'broker_url': 'zerodb://auto',
    'broker_transport': 'zerodb_celery.broker:Transport',
    'result_backend': 'zerodb_celery.backend:ZeroDBBackend',
})

Explicit credentials

Set environment variables:

export ZERODB_API_KEY=zdb_your_key_here
export ZERODB_PROJECT_ID=proj_your_id_here

Or pass them directly:

ZeroDBBroker.configure(app, api_key='zdb_...', project_id='proj_...')
ZeroDBBackend.configure(app, api_key='zdb_...', project_id='proj_...')

Credential resolution order

  1. Explicit api_key / project_id parameters
  2. ZERODB_API_KEY / ZERODB_PROJECT_ID environment variables
  3. Cached credentials in ~/.zerodb/credentials.json
  4. Auto-provision a new free project via API

How It Works

Broker (message queue)

The broker uses ZeroDB's event stream as a message queue:

  • Publish task: POST /api/v1/zerodb/events with topic celery:{queue_name}
  • Consume task: GET /api/v1/zerodb/events?topic=celery:{queue_name}&consume=true

Result backend (task results)

The backend stores results in a ZeroDB table called celery_results:

  • Store result: POST /api/v1/zerodb/tables/celery_results/rows
  • Get result: GET /api/v1/zerodb/tables/celery_results/rows/{task_id}

The table is auto-created on first use.

Use Cases

  • ML pipelines: Queue training jobs, store results — no Redis needed
  • AI agent workflows: Background task processing for agent swarms
  • Serverless apps: No infrastructure to manage alongside your Celery workers
  • Prototyping: Get Celery running in 30 seconds without Docker

Comparison

Feature Redis RabbitMQ zerodb-celery
Setup time 5-30 min 10-60 min 0 min (auto)
Infrastructure Self-hosted or managed Self-hosted or managed None
Cost $15-100+/mo $15-100+/mo Free tier
Persistence Optional (AOF/RDB) Yes Yes
Auto-provisioning No No Yes

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zerodb_celery-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zerodb_celery-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file zerodb_celery-0.1.0.tar.gz.

File metadata

  • Download URL: zerodb_celery-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_celery-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1936cfa9cd841f7ca5e4326850ee728ab285df6e8f3ccceea751649297cbf5d
MD5 5f33d5216b62326ae6baf75a2940a176
BLAKE2b-256 b9c77c7fe11b2ae17688c85b33e0bb01f4241f94615ea77eb892db61130c9cf5

See more details on using hashes here.

File details

Details for the file zerodb_celery-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zerodb_celery-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_celery-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b906ad91077f462b6292c98c564156a86574348f29802a87bc87206d9c9b63f
MD5 d9761d808121a1eb0150201fac9230eb
BLAKE2b-256 9da9e3699c43ab4e18965d747a5937fb2f3d00b254eeb499bcbf80e9fc406427

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page