{ "info": { "author": "@balex", "author_email": "balex@ucdavis.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools" ], "description": "# Flask-Webhook\n\nYet another Redis extension for Flask. `Flask-Webhook` makes use of Flask Blueprints and allows easy creation of application webhooks.\n\n[![Latest Version](https://pypip.in/version/Flask-Webhook/badge.png)]\n(https://pypi.python.org/pypi/Flask-Webhook/)\n[![Downloads](https://pypip.in/download/Flask-Webhook/badge.png)]\n(https://pypi.python.org/pypi/Flask-Webhook/)\n[![Download format](https://pypip.in/format/Flask-Webhook/badge.png)]\n(https://pypi.python.org/pypi/Flask-Webhook/)\n[![License](https://pypip.in/license/Flask-Webhook/badge.png)]\n(https://pypi.python.org/pypi/Flask-Webhook/)\n\n\n## Supported Platforms\n\n* OSX and Linux.\n* Python 2.7\n* [Flask](http://flask.pocoo.org/) 0.10.1\n\nProbably works with other versions as well.\n\n## Quickstart\n\nInstall:\n```bash\npip install Flask-Webhook\n```\n\nExample:\n```python\nfrom flask import Flask\nfrom flask.ext.webhook import WebHook\n\napp = Flask(__name__)\n\n#create webhook object (name and app are optional)\n#if app is not passed in in the constructor, my_webhook.init_app(app) is needed.\nmy_webhook = WebHook(name='optional_webhook_name', url_prefix='/webhooks' app=app)\nmy_webhook.add_route('/something', methods=['GET', 'POST'])\n\n#define a function handler to be called by the webhook\ndef some_function(hookrequest):\n do something with the request object received by the webhook\n\n#attach your function handler to the webhook.\n#you can attach as many as you want and they all are going to be called\n# () should not be included \nmy_webhook.handlers['some_name_for_your_handler'] = some_function\n```\n\n\n## Factory Example\n\n```python\n# extensions.py\nfrom flask.ext.webhook import WebHook\n\nmy_webhook = WebHook(url_prefix='/webhooks')\n```\n\n```python\n# application.py\nfrom flask import Flask\nfrom extensions import my_webhook\n\ndef some_function(request):\n do something\n\ndef some_other_function(request):\n do something else\n\ndef create_app():\n app = Flask(__name__)\n my_webhook.add_route('/something', methods=['GET', 'POST'])\n my_webhook.handlers['action1'] = some_function\n my_webhook.handlers['action2'] = some_other_function\n my_webhook.init_app(app)\n return app\n```\n\n```python\n# manage.py\nfrom application import create_app\n\napp = create_app()\napp.run()\n```\n\n## Changelog\n\n#### 0.1.0\n\n* Initial release.", "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/Bogdan-Alexandrescu/Flask-Webhook", "keywords": "flask blueprint webhook hook", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Flask-Webhook", "package_url": "https://pypi.org/project/Flask-Webhook/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Webhook/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Bogdan-Alexandrescu/Flask-Webhook" }, "release_url": "https://pypi.org/project/Flask-Webhook/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Create Flask application webhooks with attached handlers", "version": "0.1.0" }, "last_serial": 1183464, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c32e2b076ed68da1604117a430d6f753", "sha256": "be3510c0cb69edc34eeb34b3285fff5d6dc20fb573137c53cc70a90fb7d0473e" }, "downloads": -1, "filename": "Flask-Webhook-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c32e2b076ed68da1604117a430d6f753", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3706, "upload_time": "2014-08-07T23:12:21", "url": "https://files.pythonhosted.org/packages/92/83/29a9680779ec952f2cbb6ee2a9b48ea31daacfc64e9b862539c9af72998c/Flask-Webhook-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c32e2b076ed68da1604117a430d6f753", "sha256": "be3510c0cb69edc34eeb34b3285fff5d6dc20fb573137c53cc70a90fb7d0473e" }, "downloads": -1, "filename": "Flask-Webhook-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c32e2b076ed68da1604117a430d6f753", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3706, "upload_time": "2014-08-07T23:12:21", "url": "https://files.pythonhosted.org/packages/92/83/29a9680779ec952f2cbb6ee2a9b48ea31daacfc64e9b862539c9af72998c/Flask-Webhook-0.1.0.tar.gz" } ] }