Skip to main content

A simple resource based REST API extension for the bottle framework

Project description

Bottle RESTX

A simple resource based REST API extension for the bottle framework. Loosely inspired by flask-restx.

Installation

Via pip

$ pip install bottle-restx

Quickstart

The syntax is class based. Create an API object, which is a subclass of bottle.Bottle. For every resource add a subclass of the Resource class and decorate it with the API.route decorator. The route is passed to the method fitting the HTTP method.

from bottle_restx import API, Resource
api = API()

@api.route("/my/route/<id>")
class MyResource(Resource):
    def get(id):
    ...
    def post(id):
    ...
    def put(id):
    ...
    def delete(id):
    ...

The individual methods are not mandatory. You might actually discard unwanted methods. By default they produce an 405 (Method not allowed).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bottle-restx-1.0.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

bottle_restx-1.0.1-py3-none-any.whl (3.4 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