library for easy restful APIs in tornado
Project description
tornado_rest_easy - RESTful extension for tornado
This library aims to make it quicker and easier to define a RESTful API in tornado. Originally inspired by github.com/rancavil/tornado-rest.
Installation
pip install tornado_rest_easy
Usage
from tornado_rest_easy import RestfulHandler, RestfulMetaType, get, post
class WidgetHandler(RestfulHandler, metaclass=RestfulMetaType):
@get('/widgets')
def all_widgets(self):
return [widget1, widget2, ...]
@get('/widgets/<int:id>')
def get_widget(self, id):
return widgets[id]
@post('/widgets'):
def add_widget(self):
return 'Widget added'
app = Application(WidgetHandler.get_handlers(dict(db=db))
License
New BSD. See license.
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
tornado_rest_easy-0.1.tar.gz
(21.4 kB
view hashes)
Built Distribution
Close
Hashes for tornado_rest_easy-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 620281ea4c4d57550e30c8ace60257ef367af3d04cd676c006adebb32d2fe593 |
|
MD5 | 3da7947671b4cec8b06d39dc5a9adf74 |
|
BLAKE2b-256 | 037a92bb3666c83b895257eef84cab927f5a7554ac24edf91edddf1fccb8ca05 |