Skip to main content

Celery API discovery module

Project description

Given the celery instance, it inspects all available celery workers to get the information about the queues they serve and tasks they know about.

Then it creates a chain of attributes allowing to execute any task as queue_name.full_task_name.delay.

With help of this class you can turn your Celery installation to a set of independent modules, each of which “exposes” its own “Celery API”.

To make it more clear, the analogy with a random HTTP-based API available at can be like:

  • Celery object (including broker URL, result backend settings, etc) is the analogue of the protocol (http://)
  • Queue name is the analogue of the hostname (
  • Task name is the analogue of the URL path (/users/get)
  • Task parameters the the analogue the querystring (?

Usage example.

If we have a Celery installation with two queues: “download” (knows how to execute “downloader.download_url” task) and “parse” (knows how to execute “parser.parse_html”), we can instantiate API and work with it the following way:

>>> api = celery_api.CeleryApi(celery)
>>> html_page ='').get()
>>> html_tree = api.parse.parser.parse_html.delay(html_page).get()


Ensure that workers are up and available from clients for inspection. You may re-discover your installation after object creation by executing api._discover().

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Files for celery-api, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size celery-api-0.1.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page