{"id":18931978,"url":"https://github.com/crflynn/celery-slack","last_synced_at":"2025-04-15T16:33:34.087Z","repository":{"id":27005368,"uuid":"111368856","full_name":"crflynn/celery-slack","owner":"crflynn","description":"A Slack messaging extension for Celery.","archived":false,"fork":false,"pushed_at":"2023-04-01T12:47:35.000Z","size":925,"stargazers_count":17,"open_issues_count":15,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T23:43:25.392Z","etag":null,"topics":["celery","celery-slack","celerybeat","logging","slack"],"latest_commit_sha":null,"homepage":"http://celery-slack.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crflynn.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-20T06:08:08.000Z","updated_at":"2024-04-21T03:32:53.000Z","dependencies_parsed_at":"2024-11-08T11:48:20.048Z","dependency_job_id":"86df6986-0fc1-4167-9b9e-b1e6aab781a4","html_url":"https://github.com/crflynn/celery-slack","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":0.09333333333333338,"last_synced_commit":"c9d877f6c83457d27bea76a072abab22086bd7cd"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fcelery-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fcelery-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fcelery-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fcelery-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crflynn","download_url":"https://codeload.github.com/crflynn/celery-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249108488,"owners_count":21214002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","celery-slack","celerybeat","logging","slack"],"created_at":"2024-11-08T11:47:31.539Z","updated_at":"2025-04-15T16:33:33.722Z","avatar_url":"https://github.com/crflynn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"celery-slack\n============\n\n|travis| |rtd| |codecov| |pypi| |pyversions|\n\n\n.. |travis| image:: https://img.shields.io/travis/crflynn/celery-slack.svg\n    :target: https://travis-ci.org/crflynn/celery-slack\n\n.. |rtd| image:: https://img.shields.io/readthedocs/celery-slack.svg\n    :target: http://celery-slack.readthedocs.io/en/latest/\n\n.. |codecov| image:: https://codecov.io/gh/crflynn/celery-slack/branch/master/graphs/badge.svg\n    :target: https://codecov.io/gh/crflynn/celery-slack\n\n.. |pypi| image:: https://img.shields.io/pypi/v/celery-slack.svg\n    :target: https://pypi.python.org/pypi/celery-slack\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/celery-slack.svg\n    :target: https://pypi.python.org/pypi/celery-slack\n\n\nCelery-slack is a `Celery \u003chttp://docs.celeryproject.org/en/latest/index.html\u003e`_\nextension that posts messages to a Slack channel\nregarding a Celery application, its beat schedule, and its worker task\nexecution. Optionally those messages can link to\n`Flower \u003chttp://flower.readthedocs.io/en/latest/\u003e`_ task pages.\n\n.. image:: https://i.imgur.com/fDkivP8.png\n\nPrerequisites\n-------------\n\nTo use this package you will need a Slack App that is part of your\nSlack workspace. You can create an App from\n`this page \u003chttps://api.slack.com/apps\u003e`_. This App should have an incoming\nwebhook registered to one of your Slack channels. See\n`Slack incoming webhooks \u003chttps://api.slack.com/incoming-webhooks\u003e`_ for more\ninformation.\n\nInstallation\n------------\n\nCelery-slack is a python package available on pypi.\nIt can be installed using ``pip``:\n\n.. code-block:: python\n\n    pip install celery-slack\n\nBasic usage\n-----------\n\nThe most basic implementation of celery-slack requires a Celery instance object\nand a Slack webhook corresponding to a Slack channel. A simple example might\nlook something like this:\n\n.. code-block:: python\n\n    from celery import Celery\n    from celery_slack import Slackify\n\n\n    SLACK_WEBHOOK = 'https://hooks.slack.com/services/XXX/YYY/ZZZ'\n\n    app = Celery('project')\n    app.config_from_object('project.config')\n\n    slack_app = Slackify(app, SLACK_WEBHOOK)\n\n\n    if __name__ == '__main__':\n        app.start()\n\n\nAdvanced usage\n--------------\n\nCelery-slack offers a number of configuration options to customize the look\nand output of Slack messages. The following are the default options of the\nextension:\n\n.. code-block:: javascript\n\n    DEFAULT_OPTIONS = {\n        \"slack_beat_init_color\": \"#FFCC2B\",\n        \"slack_broker_connect_color\": \"#36A64F\",\n        \"slack_broker_disconnect_color\": \"#D00001\",\n        \"slack_celery_startup_color\": \"#FFCC2B\",\n        \"slack_celery_shutdown_color\": \"#660033\",\n        \"slack_task_prerun_color\": \"#D3D3D3\",\n        \"slack_task_success_color\": \"#36A64F\",\n        \"slack_task_failure_color\": \"#D00001\",\n        \"slack_request_timeout\": 1,\n        \"flower_base_url\": None,\n        \"show_celery_hostname\": False,\n        \"show_task_id\": True,\n        \"show_task_execution_time\": True,\n        \"show_task_args\": True,\n        \"show_task_kwargs\": True,\n        \"show_task_exception_info\": True,\n        \"show_task_return_value\": True,\n        \"show_task_prerun\": False,\n        \"show_startup\": True,\n        \"show_shutdown\": True,\n        \"show_beat\": True,\n        \"show_broker\": False,\n        \"use_fixed_width\": True,\n        \"include_tasks\": None,\n        \"exclude_tasks\": None,\n        \"failures_only\": False,\n        \"webhook\": None,\n        \"beat_schedule\": None,\n        \"beat_show_full_task_path\": False,\n    }\n\n\nAny subset of these options can be passed to the constructor in the form\nof keyword arguments. e.g.\n\n.. code-block:: python\n\n    options = {\n        # Some subset of options\n    }\n    app = Celery('project')\n    slack_app = Slackify(app, SLACK_WEBHOOK, **options)\n\n\nMost of the options are self explanatory, but here are some additional details:\n\n* **slack_\\*_color**: The left vertical bar color associated with the slack message attachments\n* **slack_request_timeout**: The Slack message request timeout in seconds\n* **flower_base_url**: e.g. https://flower.example.com, if provided, the slack message titles will link to task pages in `Flower \u003chttp://flower.readthedocs.io/en/latest/\u003e`_\n* **show_task_id**: Show the uuid for the task.\n* **show_task_execution_time**: Show time to complete task in minutes/seconds\n* **show_celery_hostname**: Show the machine hostname on celery/beat messages\n* **show_task_args**: Show the task's args\n* **show_task_kwargs**: Show the task's keyword args\n* **show_task_exception_info**: Show the traceback for failed tasks\n* **show_task_return_value**: Show the return value of a successful task\n* **show_task_prerun**: Post messages at start of task execution\n* **show_startup**: Post message when celery starts\n* **show_shutdown**: Post message when celery stops\n* **show_beat**: Post message when beat starts\n* **show_broker**: Post messages when celery/beat disconnect from or reconnect to the broker\n* **use_fixed_width**: Use slack fixed width formatting for args, kwargs, retval, and exception info\n* **include_tasks**: A list of task paths to include. If used, post task messages only for these tasks. Uses regex pattern matching. e.g. ``module.submodule.taskname`` for a specific task or just ``module.submodule`` for all tasks in that submodule. Cannot be used in conjunction with ``exclude_tasks``.\n* **exclude_tasks**: A list of task paths to exclude. If used, suppress task messages only for these tasks. All other tasks will generate slack messages. Cannot be used in conjunction with ``include_tasks``. Uses regex pattern matching.\n* **failures_only**: Only post messages on task failures.\n* **webhook**: The only required parameter. A slack webhook corresponding to a slack channel.\n* **beat_schedule**: The celery beat schedule. If provided, the beat_init message will display the schedule.\n* **beat_show_full_task_path**: Show the full module-task path. If False (default) only show `submodule.taskname`.\n\n\nWarnings\n--------\n\nNote that Slack has `rate limits for incoming webhook requests \u003chttps://api.slack.com/docs/rate-limits\u003e`_\nwhich is more or less 1 request per second.\nThis extension makes little effort to abide by these rate limits. You should\nensure that your implementation of celery-slack does not violate these limits\nby adjusting your task schedule or restricting the set of tasks which generate\nSlack messages using the ``include_tasks`` or ``exclude_tasks`` options.\n\nIf a webhook response contains response code 429, celery-slack will suppress\nall messages for a time period given by the Retry-After response header. Upon\nreturning, celery-slack will post a WARNING message to Slack.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fcelery-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrflynn%2Fcelery-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fcelery-slack/lists"}