Yet another Redis extension for Flask. `Flask-Webhook` makes use of Flask Blueprints and allows easy creation of application webhooks.
[]
(https://pypi.python.org/pypi/Flask-Webhook/)
[]
(https://pypi.python.org/pypi/Flask-Webhook/)
[]
(https://pypi.python.org/pypi/Flask-Webhook/)
[]
(https://pypi.python.org/pypi/Flask-Webhook/)
## Supported Platforms
* OSX and Linux.
* Python 2.7
* [Flask](http://flask.pocoo.org/) 0.10.1
Probably works with other versions as well.
## Quickstart
Install:
```bash
pip install Flask-Webhook
```
Example:
```python
from flask import Flask
from flask.ext.webhook import WebHook
app = Flask(__name__)
#create webhook object (name and app are optional)
#if app is not passed in in the constructor, my_webhook.init_app(app) is needed.
my_webhook = WebHook(name='optional_webhook_name', url_prefix='/webhooks' app=app)
my_webhook.add_route('/something', methods=['GET', 'POST'])
#define a function handler to be called by the webhook
def some_function(hookrequest):
do something with the request object received by the webhook
#attach your function handler to the webhook.
#you can attach as many as you want and they all are going to be called
# () should not be included
my_webhook.handlers['some_name_for_your_handler'] = some_function
```
## Factory Example
```python
# extensions.py
from flask.ext.webhook import WebHook
my_webhook = WebHook(url_prefix='/webhooks')
```
```python
# application.py
from flask import Flask
from extensions import my_webhook
def some_function(request):
do something
def some_other_function(request):
do something else
def create_app():
app = Flask(__name__)
my_webhook.add_route('/something', methods=['GET', 'POST'])
my_webhook.handlers['action1'] = some_function
my_webhook.handlers['action2'] = some_other_function
my_webhook.init_app(app)
return app
```
```python
# manage.py
from application import create_app
app = create_app()
app.run()
```
## Changelog
#### 0.1.0
* Initial release.
Metadata
Release files for Flask-Webhook 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Flask-Webhook-0.1.0.tar.gz | 3.7 kB | Without provenance | Details for Flask-Webhook-0.1.0.tar.gz |
Release files / Flask-Webhook-0.1.0.tar.gz
| Download URL | Flask-Webhook-0.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be3510c0cb69edc34eeb34b3285fff5d6dc20fb573137c53cc70a90fb7d0473e
|
|
BLAKE2b-256 checksum How to use checksums |
928329a9680779ec952f2cbb6ee2a9b48ea31daacfc64e9b862539c9af72998c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-Webhook 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.