Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install celery-api

How to install celery-api

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install celery-api
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.1 Available View build log
 
License
BSD
Dependencies
Imports
Lastest release
version 0.1 on Jan 9th, 2014

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 http://example.com/users/get?email=john@example.com 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 (example.com)
  • Task name is the analogue of the URL path (/users/get)
  • Task parameters the the analogue the querystring (?email=john@example.com)

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:

System Message: ERROR/3 (<string>, line 31)

Unknown directive type "code-block".

.. code-block:: python

    >>> api = celery_api.CeleryApi(celery)
    >>> html_page = api.download.downloader.download_html.delay('http://example.com').get()
    >>> html_tree = api.parse.parser.parse_html.delay(html_page).get()

Note

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

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.