{"id":17703784,"url":"https://github.com/shawalli/flask-github-webhook","last_synced_at":"2025-03-13T07:32:07.326Z","repository":{"id":57430348,"uuid":"125506800","full_name":"shawalli/flask-github-webhook","owner":"shawalli","description":"This project extends the python-github-webhook project to work with Flask.","archived":false,"fork":false,"pushed_at":"2020-07-22T15:24:56.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T09:37:14.022Z","etag":null,"topics":["flask","flask-extensions","github","github-webhooks","python","webhooks"],"latest_commit_sha":null,"homepage":"","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/shawalli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-16T11:22:24.000Z","updated_at":"2021-01-17T16:41:16.000Z","dependencies_parsed_at":"2022-08-26T03:51:04.491Z","dependency_job_id":null,"html_url":"https://github.com/shawalli/flask-github-webhook","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawalli%2Fflask-github-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawalli%2Fflask-github-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawalli%2Fflask-github-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawalli%2Fflask-github-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawalli","download_url":"https://codeload.github.com/shawalli/flask-github-webhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243361380,"owners_count":20278559,"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":["flask","flask-extensions","github","github-webhooks","python","webhooks"],"created_at":"2024-10-24T21:05:56.765Z","updated_at":"2025-03-13T07:32:06.944Z","avatar_url":"https://github.com/shawalli.png","language":"Python","readme":"# Flask-Github-Webhook\n\n[![Build Status](https://travis-ci.org/shawalli/flask-github-webhook.svg?branch=master)](https://travis-ci.org/shawalli/flask-github-webhook)\n[![Coverage Status](https://coveralls.io/repos/github/shawalli/flask-github-webhook/badge.svg?branch=master)](https://coveralls.io/github/shawalli/flask-github-webhook?branch=master)\n\nFlask-Github-Webhook adds extension support for GitHub webhooks to Flask. This extension primarily extends the [python-github-webhook](https://github.com/bloomberg/python-github-webhook) project by making the [Flask Extension Pattern](http://flask.pocoo.org/docs/latest/patterns/appfactories/#factories-extensions) available as an initialization option.\n\n## Initialization\nThe Github-Webhook Extension may be initialized directly or as an extension:\n\n**Direct Setup**\n```\nfrom flask import Flask\nfrom flask_github_webhook import GithubWebhook\n\napp = Flask(__name__)\nwebhook = GithubWebhook(app)\n```\n\n**Extension Setup**\n```\nfrom flask import Flask\n\n# The extension may be initialized from anywhere in the project, including\n# inside this file, by calling GithubWebhook()\nfrom .extension import WEBHOOK\n\napp = Flask(__name__)\nWEBHOOK.init_app(app)\n```\n\n## Usage\nThe extension may be used in the same manner as `python-github-webhook`.\n```\nfrom .extension import WEBHOOK\n\n@WEBHOOK.hook()\ndef push_handler(data):\n    print('Received the following PUSH event:{}'.format(data))\n\n@WEBHOOK.hook(event_type='pull_request')\ndef pullrequest_handler(data):\n    print('Received the following PULL-REQUEST event:{}'.format(data))\n```\n\n## Versions\nVersion 0.1.x supports `^2.7` and `^3.4`.\n\nVersions 0.2+ supports `^3.6.7`. This is primarily due to Python version\nconstraints on the package and test tools. For instance, here are some\ndependencies and their supported Python versions: `poetry=^3.4`,\n`coveralls=^3.5`, `pre-commit=^3.6.1`, and `pytest=^3.6`. Due to these\nconstraints, the decision was made to drop official support for `2.7`, `3.4`\nand `3.5`. However, `flask-github-webhook=^0.1.x` should work for older\nPython versions.\n\n## Configuration\nThe extension has the same configurations available as the `python-github-webhook` package. However, unlike referenced package, this extension reads those configurations from the Flask application, not initialization arguments. The values below should be configured in the Flask application (app.config) prior to initializing the extension.\n\n### GITHUB_WEBHOOK_ENDPOINT\nThis setting declares the route that all webhook event handlers will use. If left unset, the setting will default to the endpoint as declared in `python-github-webook`. As of this writing, the default endpoint is `/postreceive`.\n\n### GITHUB_WEBHOOK_SECRET\nIf provided, this setting's value should match the secret set in the GitHub repository from which this extension will receive webhooks.\n\n## Contributing\nContributions are welcomed! If you would like to improve or modify Flask-Github-Webhook, please follow these steps:\n1. Fork this repository.\n2. Make your changes and create a pull request.\n3. Ensure that all status checks are passing.\n\n## Author \u0026 License\nThis package is released under an open source MIT License. Flask-Github-Webhook was originally written by [Shawn Wallis](https://github.com/shawalli).\n\n## References\n* [python-github-webhook](https://github.com/bloomberg/python-github-webhook)\n* [GitHub Webhook Development Guide](https://developer.github.com/webhooks)\n* [Flask Extension Pattern](http://flask.pocoo.org/docs/latest/patterns/appfactories/#factories-extensions)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawalli%2Fflask-github-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawalli%2Fflask-github-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawalli%2Fflask-github-webhook/lists"}