{ "info": { "author": "John Anderson", "author_email": "sontek@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "Getting Started\n=====================\n.. image:: https://travis-ci.org/sontek/pyramid_celery.png?branch=master\n :target: https://travis-ci.org/sontek/pyramid_celery\n\n.. image:: https://coveralls.io/repos/sontek/pyramid_celery/badge.png?branch=master\n :target: https://coveralls.io/r/sontek/pyramid_celery?branch=master\n\n.. image:: https://img.shields.io/pypi/v/pyramid_celery.svg\n :target: https://pypi.python.org/pypi/pyramid_celery\n\nInclude pyramid_celery either by setting your includes in your .ini,\nor by calling ``config.include('pyramid_celery')``:\n\n.. code-block:: ini\n\n pyramid.includes = pyramid_celery\n\n\nThen you just need to tell **pyramid_celery** what ini file your **[celery]**\nsection is in:\n\n.. code-block:: python\n\n config.configure_celery('development.ini')\n\nThen you are free to use celery, for example class based:\n\n.. code-block:: python\n\n from pyramid_celery import celery_app as app\n\n class AddTask(app.Task):\n def run(self, x, y):\n print x+y\n\nor decorator based:\n\n.. code-block:: python\n\n from pyramid_celery import celery_app as app\n\n @app.task\n def add(x, y):\n print x+y\n\nTo get pyramid settings you may access them in ``app.conf['PYRAMID_REGISTRY']``.\n\nConfiguration\n=====================\nBy default **pyramid_celery** assumes you want to configure celery via an ini\nsettings. You can do this by calling **config.configure_celery('development.ini')**\nbut if you are already in the **main** of your application and want to use the ini\nused to configure the app you can do the following:\n\n.. code-block:: python\n\n config.configure_celery(global_config['__file__'])\n\nIf you want to use the standard **celeryconfig** python file you can set the\n**USE_CELERYCONFIG = True** like this:\n\n.. code-block:: ini\n\n [celery]\n USE_CELERYCONFIG = True\n\nYou can get more information for celeryconfig.py here:\n\nhttp://celery.readthedocs.org/en/latest/configuration.html\n\nAn example ini configuration looks like this:\n\n.. code-block:: ini\n\n [celery]\n BROKER_URL = redis://localhost:1337/0\n CELERY_IMPORTS = app1.tasks\n app2.tasks\n\n [celerybeat:task1]\n task = app1.tasks.Task1\n type = crontab\n schedule = {\"minute\": 0}\n\nScheduled/Periodic Tasks\n-----------------------------\nTo use celerybeat (periodic tasks) you need to declare 1 ``celerybeat`` config\nsection per task. The options are:\n\n- **task** - The python task you need executed.\n- **type** - The type of scheduling your configuration uses, options are\n ``crontab``, ``timedelta``, and ``integer``.\n- **schedule** - The actual schedule for your ``type`` of configuration.\n- **args** - Additional positional arguments.\n- **kwargs** - Additional keyword arguments.\n\nExample configuration for this:\n\n.. code-block:: ini\n\n [celerybeat:task1]\n task = app1.tasks.Task1\n type = crontab\n schedule = {\"minute\": 0}\n\n [celerybeat:task2]\n task = app1.tasks.Task2\n type = timedelta\n schedule = {\"seconds\": 30}\n args = [16, 16]\n\n [celerybeat:task3]\n task = app2.tasks.Task1\n type = crontab\n schedule = {\"hour\": 0, \"minute\": 0}\n kwargs = {\"boom\": \"shaka\"}\n\n [celerybeat:task4]\n task = myapp.tasks.Task4\n type = integer\n schedule = 30\n\nA gotcha you want to watchout for is that the date/time in scheduled tasks\nis UTC by default. If you want to schedule for an exact date/time for your\nlocal timezone you need to set ``CELERY_TIMEZONE``. Documentation for that\ncan be found here:\n\nhttp://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html#time-zones\n\nIf you need to find out what timezones are available you can do the following:\n\n.. code-block:: python\n\n from pprint import pprint\n from pytz import all_timezones\n pprint(all_timezones)\n\nWorker Execution\n----------------\nThe celerybeat worker will read your configuration and schedule tasks in the\nqueue to be executed at the time defined. This means if you are using\ncelerybeat you will end up running *2* workers:\n\n.. code-block:: bash\n\n $ celery worker -A pyramid_celery.celery_app --ini development.ini\n $ celery beat -A pyramid_celery.celery_app --ini development.ini\n\nThe first command is the standard worker command that will read messages off\nof the queue and run the task. The second command will read the celerybeat\nconfiguration and periodically schedule tasks on the queue.\n\n\nRouting\n-----------------------------\nIf you would like to route a task to a specific queue you can define a route\nper task by declaring their ``queue`` and/or ``routing_key`` in a\n``celeryroute`` section.\n\nAn example configuration for this:\n\n.. code-block:: ini\n\n [celeryroute:otherapp.tasks.Task3]\n queue = slow_tasks\n routing_key = turtle\n\n [celeryroute:myapp.tasks.Task1]\n queue = fast_tasks\n\nRunning the worker\n=============================\nTo run the worker we just use the standard celery command with an additional\nargument:\n\n.. code-block:: bash\n\n celery worker -A pyramid_celery.celery_app --ini development.ini\n\nIf you've defined variables in your .ini like %(database_username)s you can use\nthe *--ini-var* argument, which is a comma separated list of key value pairs:\n\n.. code-block:: bash\n\n celery worker -A pyramid_celery.celery_app --ini development.ini --ini-var=database_username=sontek,database_password=OhYeah!\n\nThe values in *ini-var* cannot have spaces in them, this will break celery's\nparser.\n\nThe reason it is a csv instead of using *--ini-var* multiple times is because of\na bug in celery itself. When they fix the bug we will re-work the API. Ticket\nis here:\n\nhttps://github.com/celery/celery/pull/2435\n\nIf you use celerybeat scheduler you need to run with the *--beat* flag to run\nbeat and the worker at the same time.\n\n.. code-block:: bash\n\n celery worker --beat -A pyramid_celery.celery_app --ini development.ini\n\nOr you can launch it separately like this:\n\n.. code-block:: bash\n\n celery beat -A pyramid_celery.celery_app --ini development.ini\n\nLogging\n=====================\nIf you use the **.ini** configuration (i.e don't use celeryconfig.py) then the\nlogging configuration will be loaded from the .ini and will not use the default\ncelery loggers.\n\nYou most likely want to add a logging section to your ini for celery as well:\n\n.. code-block:: ini\n\n [logger_celery]\n level = INFO\n handlers =\n qualname = celery\n\nand then update your ``[loggers]`` section to include it.\n\nIf you want use the default celery loggers then you can set\n**CELERYD_HIJACK_ROOT_LOGGER=True** in the [celery] section of your .ini.\n\nCelery worker processes do not propagade exceptions inside tasks, but swallow them \nsilently by default. This is related to the behavior of reading asynchronous \ntask results back. To see if your tasks fail you might need to configure \n``celery.worker.job`` logger to propagate exceptions:\n\n.. code-block:: ini\n\n # Make sure Celery worker doesn't silently swallow exceptions\n # See http://stackoverflow.com/a/20719461/315168 \n # https://github.com/celery/celery/issues/2437\n [logger_celery_worker_job]\n level = ERROR\n handlers = \n qualname = celery.worker.job\n propagate = 1\n\nIf you want use the default celery loggers then you can set\n**CELERYD_HIJACK_ROOT_LOGGER=True** in the [celery] section of your .ini\n\nDemo\n=====================\nTo see it all in action check out examples/long_running_with_tm, run\nredis-server and then do:\n\n.. code-block:: bash\n\n $ python setup.py develop\n $ populate_long_running_with_tm development.ini\n $ pserve ./development.ini\n $ celery worker -A pyramid_celery.celery_app --ini development.ini\n\n3.0.0\n================\n\n- Support celery 4.0\n- Properly handle CELERY_ALWAYS_EAGER\n- Handle tuple in ADMINS", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sontek/pyramid_celery", "keywords": "paste pyramid celery message queue amqp job task distributed", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyramid_celery", "package_url": "https://pypi.org/project/pyramid_celery/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_celery/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sontek/pyramid_celery" }, "release_url": "https://pypi.org/project/pyramid_celery/3.0.0/", "requires_dist": null, "requires_python": null, "summary": "Celery integration with pyramid", "version": "3.0.0" }, "last_serial": 2537712, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "baa97d10518394186a0f391da88efdec", "sha256": "133b4fff85a221ddb5d88ee0bf0a961bb82af45da04f4c897f35eda4b1e98dfe" }, "downloads": -1, "filename": "pyramid_celery-0.1.tar.gz", "has_sig": false, "md5_digest": "baa97d10518394186a0f391da88efdec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3847, "upload_time": "2012-03-14T20:47:39", "url": "https://files.pythonhosted.org/packages/3d/b0/cec6c2162c390356d804f1bdab2609ed2e24fd43f404e217eada07725562/pyramid_celery-0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "85c6f95d99dbfdc6ed0ddcd959f113d1", "sha256": "4e632d2734bb42e3c79974c51430cf03bbe69939273ad76bc2cdd69683c821d5" }, "downloads": -1, "filename": "pyramid_celery-1.1.tar.gz", "has_sig": false, "md5_digest": "85c6f95d99dbfdc6ed0ddcd959f113d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4225, "upload_time": "2012-03-24T20:23:20", "url": "https://files.pythonhosted.org/packages/5c/b1/df95aef42b00d6f897170bc9215860c3e46c9ad50e44be492276d363015f/pyramid_celery-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "bcb2ed27fbb384b5b2364af3c3d4d7dd", "sha256": "80c274c8894f4e7287a137182635da477d64a8d473dfe6b9e22a95bf695b60c1" }, "downloads": -1, "filename": "pyramid_celery-1.2.tar.gz", "has_sig": false, "md5_digest": "bcb2ed27fbb384b5b2364af3c3d4d7dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4208, "upload_time": "2012-03-24T20:48:58", "url": "https://files.pythonhosted.org/packages/8f/ee/1bc614f8a0e420ed8d25981bf2ee64cecb9b83579ee6c85cea70b2b5d706/pyramid_celery-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "9720e6d78ab5683aa1c1b64119c0a56e", "sha256": "c223505d76286c3ddc490d7464642afc0035ee570e903e33907a3fa4d58ca6a0" }, "downloads": -1, "filename": "pyramid_celery-1.2.1.tar.gz", "has_sig": false, "md5_digest": "9720e6d78ab5683aa1c1b64119c0a56e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4414, "upload_time": "2012-07-24T01:43:25", "url": "https://files.pythonhosted.org/packages/e5/b1/8d887e87c0c36fc7231da3e730aedde162fb9362d6f2d46d7362f18cde2b/pyramid_celery-1.2.1.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "7d52ad11bbe7067e66850d3657860254", "sha256": "1c078836142b4579b8effeeef96fd4386dbb9467d02c6758bd26f8df67781b46" }, "downloads": -1, "filename": "pyramid_celery-1.3.tar.gz", "has_sig": false, "md5_digest": "7d52ad11bbe7067e66850d3657860254", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4409, "upload_time": "2012-10-02T19:42:46", "url": "https://files.pythonhosted.org/packages/a1/11/c8cdf98ed72966336915190132cef9b707b547ac921f8f14a8bc4795398a/pyramid_celery-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "0b19972a185c75e14628b3db1abbb49d", "sha256": "71adcf067277f4ca70755f9324fe99c5244f6c43785ddb82d03c6675e8c272a1" }, "downloads": -1, "filename": "pyramid_celery-1.4.tar.gz", "has_sig": false, "md5_digest": "0b19972a185c75e14628b3db1abbb49d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4806, "upload_time": "2014-12-15T09:19:48", "url": "https://files.pythonhosted.org/packages/da/28/bddd1cd53108cfdaa73c0923c5fe02ef31fe8208817e35b66f0e03dd9a23/pyramid_celery-1.4.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "1187d9bd959e5cd3814c79d23a9dc046", "sha256": "1f4fb32fd9a1e17f19821c8baa7a35b9e29a11903071a9cedd429483def687d1" }, "downloads": -1, "filename": "pyramid_celery-2.0.0.tar.gz", "has_sig": false, "md5_digest": "1187d9bd959e5cd3814c79d23a9dc046", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5955, "upload_time": "2015-02-04T06:54:31", "url": "https://files.pythonhosted.org/packages/9e/1a/d7c0ab85f01e7386a1e4f83e9ad165a0f46f775b5dab7085b79412bd5058/pyramid_celery-2.0.0.tar.gz" } ], "2.0.0-rc3": [ { "comment_text": "", "digests": { "md5": "bb29344c4810cf565df8099fed5b9a65", "sha256": "139ac61f6a3618abe01523d4248e6b9ecd1d5b57cd4b03bdcbf3c0766fdf5acc" }, "downloads": -1, "filename": "pyramid_celery-2.0.0-rc3.tar.gz", "has_sig": false, "md5_digest": "bb29344c4810cf565df8099fed5b9a65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5871, "upload_time": "2014-12-29T04:52:55", "url": "https://files.pythonhosted.org/packages/c1/e8/4ad34bd47d8dc99f95bb1fcad9fceabc459b9496683e895bfbb880853bb9/pyramid_celery-2.0.0-rc3.tar.gz" } ], "2.0.0-rc4": [ { "comment_text": "", "digests": { "md5": "3cafa4b672dc80897c20300c631c6e9a", "sha256": "0a686e7d4314465400189062c59ba6ac2ca2d5026bf3762ed0171e179394677b" }, "downloads": -1, "filename": "pyramid_celery-2.0.0-rc4.tar.gz", "has_sig": false, "md5_digest": "3cafa4b672dc80897c20300c631c6e9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5230, "upload_time": "2015-01-12T16:35:20", "url": "https://files.pythonhosted.org/packages/a1/99/d11a16865fcd15d7014883d4cae4344121421f797dc05d0ebd9cc4a3232f/pyramid_celery-2.0.0-rc4.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "b1a9414547b5e5cd14efbd7433286a65", "sha256": "06bfdcdfad433b3ca8e86932ea6528159ff3c66af4b6fbdefeea232d51c46d22" }, "downloads": -1, "filename": "pyramid_celery-3.0.0.tar.gz", "has_sig": false, "md5_digest": "b1a9414547b5e5cd14efbd7433286a65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13678, "upload_time": "2016-12-24T03:58:09", "url": "https://files.pythonhosted.org/packages/46/df/5d0aeb7c1f48ed02f203ae33ec43688f4027ac5dcf092b3b95be7a1eaf9e/pyramid_celery-3.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b1a9414547b5e5cd14efbd7433286a65", "sha256": "06bfdcdfad433b3ca8e86932ea6528159ff3c66af4b6fbdefeea232d51c46d22" }, "downloads": -1, "filename": "pyramid_celery-3.0.0.tar.gz", "has_sig": false, "md5_digest": "b1a9414547b5e5cd14efbd7433286a65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13678, "upload_time": "2016-12-24T03:58:09", "url": "https://files.pythonhosted.org/packages/46/df/5d0aeb7c1f48ed02f203ae33ec43688f4027ac5dcf092b3b95be7a1eaf9e/pyramid_celery-3.0.0.tar.gz" } ] }