Skip to main content

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

This version

0.1

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)

Uploaded Source

Built Distribution

tornado_rest_easy-0.1-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page