Let you use function annotations (PEP 3107) to getarguments from flask http requests
Project description
=========
ThunderArgs
=========
Abstract
--------
Bla-bla-bla bla-bla-bla
Installation
------------
sudo pip install thunderargs --pre
Usage
-----
You can use it like this:
from thunderargs import Arg
from thunderargs.endpoint import Endpoint
@Endpoint
def max_int(x: Arg(int), y: Arg(int)):
return max(x,y)
Or you can use it with flask, like this:
@app.route('/calc_with_expander/')
def calc_with_expander(x:Arg(int), y:Arg(int),
op:Arg(str, default='+', expander=OPERATION)):
return str(op(x,y))
Or you can write yourself adapter to any other framework!
Read the example.py, flask-example.py and thunderargs/flask.py
ThunderArgs
=========
Abstract
--------
Bla-bla-bla bla-bla-bla
Installation
------------
sudo pip install thunderargs --pre
Usage
-----
You can use it like this:
from thunderargs import Arg
from thunderargs.endpoint import Endpoint
@Endpoint
def max_int(x: Arg(int), y: Arg(int)):
return max(x,y)
Or you can use it with flask, like this:
@app.route('/calc_with_expander/')
def calc_with_expander(x:Arg(int), y:Arg(int),
op:Arg(str, default='+', expander=OPERATION)):
return str(op(x,y))
Or you can write yourself adapter to any other framework!
Read the example.py, flask-example.py and thunderargs/flask.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
thunderargs-0.2.2.zip
(11.6 kB
view hashes)