{"id":37074865,"url":"https://github.com/longstem/flask-slack-events","last_synced_at":"2026-01-14T08:48:55.172Z","repository":{"id":57430750,"uuid":"173533470","full_name":"longstem/flask-slack-events","owner":"longstem","description":"Slack event subscriptions for Flask and Asyncio","archived":false,"fork":false,"pushed_at":"2019-03-05T00:27:59.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-26T07:43:51.808Z","etag":null,"topics":["async","bot","events","flask","slack","subscriptions"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/Flask-Slack-Events/","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/longstem.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-03T05:09:36.000Z","updated_at":"2020-10-02T17:09:55.000Z","dependencies_parsed_at":"2022-09-13T15:21:20.172Z","dependency_job_id":null,"html_url":"https://github.com/longstem/flask-slack-events","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/longstem/flask-slack-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longstem%2Fflask-slack-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longstem%2Fflask-slack-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longstem%2Fflask-slack-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longstem%2Fflask-slack-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/longstem","download_url":"https://codeload.github.com/longstem/flask-slack-events/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longstem%2Fflask-slack-events/sbom","scorecard":{"id":598209,"data":{"date":"2025-08-11","repo":{"name":"github.com/longstem/flask-slack-events","commit":"0b25d7dd16d2b8ae2d893f2ee822e952c8996a1d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T23:42:20.241Z","repository_id":57430750,"created_at":"2025-08-20T23:42:20.241Z","updated_at":"2025-08-20T23:42:20.241Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["async","bot","events","flask","slack","subscriptions"],"created_at":"2026-01-14T08:48:54.517Z","updated_at":"2026-01-14T08:48:55.144Z","avatar_url":"https://github.com/longstem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flask Slack Events\n==================\n\n|Pypi| |Build Status| |Codecov| |Code Climate|\n\n\n`Slack event subscriptions \u003chttps://api.slack.com/events-api#subscriptions\u003e`_ for `Flask \u003chttp://flask.pocoo.org\u003e`_\n\n\nInstallation\n------------\n\nInstall last stable version from Pypi::\n\n    pip install flask-slack-events\n\n\nCreate a Slack bot user\n-----------------------\n\nSee the `Slack's documentation \u003chttps://api.slack.com/bot-users#getting-started\u003e`_ for further guidance on creating your bot (**step 1**).\n\nWithin the *Basic Information* about your application, copy the **Signing Secret** necessary to `verify requests from Slack \u003chttps://api.slack.com/docs/verifying-requests-from-slack\u003e`_.\n\n..  image:: https://user-images.githubusercontent.com/5514990/53696736-cfde0e00-3dfc-11e9-9aeb-23d184f8c600.png\n    :alt: Signing Secret\n\n\nConfigure your Application\n--------------------------\n\nYou should create a ``SlackManager`` object within your application:\n\n.. code-block:: python\n\n    slack_manager = SlackManager()\n\n`Configure your application object \u003chttp://flask.pocoo.org/docs/1.0/config/#configuration-basics\u003e`_ updating the ``SLACK_SIGNING_SECRET`` key with the value obtained in the previous **step 1**:\n\n.. code-block:: python\n\n    app.config['SLACK_SIGNING_SECRET'] = '\u003cyour Signing Secret\u003e'\n\nOnce the actual application object has been created, you can configure it for *SlackManager* object with::\n\n    slack_manager.init_app(app)\n\n\nConfigure your Slack Bot\n------------------------\n\nContinue with the `Slacks's documentation \u003chttps://api.slack.com/bot-users#setup-events-api\u003e`_ to setting up the Events API (**step 2**) and enter the URL to receive the subscriptions joining your host and the relative path ``/slack/events``:\n\n..  image:: https://user-images.githubusercontent.com/5514990/53696747-e5533800-3dfc-11e9-8cef-4fd13d06e6ef.png\n    :alt: Enable Event\n\nFinally, install your bot to a workspace (**step 3**).\n\n\nHow it Works\n------------\n\nNow in order to subscribe to `Slack Events \u003chttps://api.slack.com/events\u003e`_, use the ``SlackManager.on`` decorator:\n\n.. code-block:: python\n\n    # Reply to only the message events that mention your bot\n\n    @slack_manager.on('app_mention')\n    def reply_to_app_mention(sender, data, **extra):\n        event = data['event']\n        channel = event['channel']\n        text = f\":robot_face: Hello \u003c@{event['user']}\u003e!\"\n\n        slack_client.api_call('chat.postMessage', channel=channel, text=text)\n\n\nContext Processors\n------------------\n\nTo inject new variables automatically into the context of a handler, context processors exist in *Flask-Slack-Events*.\n\nA context processor is a function that returns a dictionary:\n\n.. code-block:: python\n\n    @slack_manager.context_processor\n    def context_processor(data):\n        return dict(my_bot_id='UAZ02BCBH')\n\nThe injected variables will be sent as an ``extra`` argument for each event handler ``f(sender, data, **extra)``.\n\n\nDispatch Events Asynchronously\n------------------------------\n\nSome event handlers can delay the execution of another, to avoid this you can configure the event dispatcher and run handlers asynchronously:\n\n.. code-block:: python\n\n    import asyncio\n\n\n    @slack_manager.dispatch_event_handler\n    def async_event_dispatcher(sender, data, handlers, **extra):\n        coroutines = [h(sender, data, **extra) for h in handlers]\n        asyncio.run(asyncio.wait(coroutines))\n\nAnd design your event handlers as coroutines:\n\n.. code-block:: python\n\n    @slack_manager.on('app_mention')\n    async def reply_to_app_mention(sender, data, **extra):\n        # ...\n\n\nSubscribe to Signals\n--------------------\n\nThe following signals are sended internally by *Flask-Slack-Events*:\n\nsignals.request_unauthorized\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Sent when the request received is unauthorized\n\n    Receiver: ``f(sender, **extra)``\n\nsignals.expired_event\n~~~~~~~~~~~~~~~~~~~~~\n\n    Sent when the event has expired according to the value of ``SLACK_EVENT_EXPIRATION_DELTA`` and the HTTP header ``X-Slack-Request-Timestamp`` received\n\n    Receiver: ``f(sender, **extra)``\n\nsignals.invalid_signature\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Sent when the signature included within the HTTP header ``X-Slack-Signature`` is invalid\n\n    Receiver: ``f(sender, **extra)``\n\n\nsignals.event_received\n~~~~~~~~~~~~~~~~~~~~~~\n\n    Sent when an event has been received\n\n    Receiver: ``f(sender, data, **extra)``\n\n\nSlackManager Handlers\n---------------------\n\nThe following handlers are used internally by *Flask-Slack-Events*:\n\nSlackManager.unauthorized_handler\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Called to handle an unauthorized request\n\n    Handler: ``f()``\n\n    Default: ``SlackManager.unauthorized()``\n\nSlackManager.expired_event_handler\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Called to handle an expired event\n\n    Handler: ``f()``\n\n    Default: ``SlackManager.expired_event()``\n\nSlackManager.invalid_signature_handler\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Called to handle a request with an invalid signature\n\n    Handler: ``f()``\n\n    Default: ``SlackManager.invalid_signature()``\n\n\nSlackManager.dispatch_event_handler\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Called to dispatch the event to all handlers connected with ``SlackManager.on(event_type)`` decorator\n\n    Handler: ``f(sender, data, handlers, **extra)``\n\n    Default: ``SlackManager.dispatch_event(data)``\n\n\nConfiguration\n-------------\n\nThe following configuration values are used internally by *Flask-Slack-Events*:\n\nSLACK_SIGNING_SECRET\n~~~~~~~~~~~~~~~~~~~~\n\n    Signing Secret to verify whether requests from *Slack* are authentic\n\n    Default: ``''``\n\nSLACK_EVENTS_URL\n~~~~~~~~~~~~~~~~\n\n    URL rule that is used to register the *Subscription View*\n\n    Default: ``/slack/events``\n\nSLACK_EVENT_EXPIRATION_DELTA\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Timedelta added to ``time.time()`` to set the expiration time of each event\n    If the value is ``None`` then the event never expires\n\n    Default: ``timedelta(seconds=60 * 5)`` (5 minutes)\n\n\nMarvin the Paranoid Android\n---------------------------\n\n`Marvin \u003chttps://github.com/longstem/marvin\u003e`_ is a **Slack Bot layout** for *Flask* and *Asyncio* to develop `Slack Event \u003chttps://api.slack.com/events\u003e`_ handlers and deploy on *AWS Lambda* + *API Gateway*\n\n\n.. |Pypi| image:: https://img.shields.io/pypi/v/flask-slack-events.svg\n   :target: https://pypi.python.org/pypi/flask-slack-events\n   :alt: Pypi\n\n.. |Build Status| image:: https://travis-ci.org/longstem/flask-slack-events.svg?branch=master\n   :target: https://travis-ci.org/longstem/flask-slack-events\n   :alt: Build Status\n\n.. |Codecov| image:: https://img.shields.io/codecov/c/github/longstem/flask-slack-events.svg\n   :target: https://codecov.io/gh/longstem/flask-slack-events\n   :alt: Codecov\n\n.. |Code Climate| image:: https://api.codeclimate.com/v1/badges/c79a185d546f7e34fdd6/maintainability\n   :target: https://codeclimate.com/github/longstem/flask-slack-events\n   :alt: Codeclimate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongstem%2Fflask-slack-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongstem%2Fflask-slack-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongstem%2Fflask-slack-events/lists"}