semvec/pypi-packages huggingface dataset:
Flask-Webhook 0.1.0
Create Flask application webhooks with attached handlers
License: MIT
Keywords: flask blueprint webhook hook

# Flask-Webhook

Yet another Redis extension for Flask. `Flask-Webhook` makes use of Flask Blueprints and allows easy creation of application webhooks.

[![Latest Version](https://pypip.in/version/Flask-Webhook/badge.png)]
(https://pypi.python.org/pypi/Flask-Webhook/)
[![Downloads](https://pypip.in/download/Flask-Webhook/badge.png)]
(https://pypi.python.org/pypi/Flask-Webhook/)
[![Download format](https://pypip.in/format/Flask-Webhook/badge.png)]
(https://pypi.python.org/pypi/Flask-Webhook/)
[![License](https://pypip.in/license/Flask-Webhook/badge.png)]
(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.
ds9norm 0.1
A Matplotlib normalize object that replicates DS9 image stretching
License: MIT

ds9norm
=======

This file implements a matplotlib Normalize object which mimics the
functionality of image scaling functions in
`ds9 <http://ds9.si.edu/site/Home.html>`__. It provides 5 ways of
configuring image scaling:

-  Clipping the low and high intensities at specified percentiles
   (``clip_lo``, ``clip_hi``)
-  Specifying an intensity transfer function for ramping from black to
   white (``stretch``)
-  Setting the mid-point of this transfer function (``bias``, akin to
   dragging the right mouse button left/right in ds9)
-  Setting how sharp the transition from black-white is (``contrast``,
   akin to dragging the right mouse button up/down in ds9)

Examples
--------

See the `example
notebook <http://nbviewer.ipython.org/github/glue-viz/ds9norm/blob/master/Examples.ipynb>`__

.. code:: python


    data = fits.getdata('M51.fits')
    norm = DS9Normalize(bias=0.2)
    figure, axs = plt.subplots(ncols=3, nrows=3, squeeze=False, tight_layout=True)

    for ax, bias in zip(axs[2], [.2, .5, .8]):
        ax.imshow(data, norm=DS9Normalize(bias=bias))
        ax.set_title('Bias = %0.1f' % bias)

    for ax, contrast in zip(axs[1], [0.5, 1, 2]):
        ax.imshow(data, norm=DS9Normalize(contrast=contrast))
        ax.set_title('Contrast = %0.1f' % contrast)

    for ax, stretch in zip(axs[0], ['linear', 'sqrt', 'arcsinh']):
        ax.imshow(data, norm=DS9Normalize(stretch=stretch))
        ax.set_title(stretch)

.. figure:: gallery.png
   :alt: ds9norm demo

   ds9norm demo
Build Status
------------

[|Build Status|\ ]
(https://travis-ci.org/glue-viz/ds9norm?branch=master) [|Coverage
Status|\ ] (https://coveralls.io/r/glue-viz/ds9norm)

.. |Build Status| image:: https://travis-ci.org/glue-viz/ds9norm.png
.. |Coverage Status| image:: https://coveralls.io/repos/glue-viz/ds9norm/badge.png