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
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
bottle-restx-1.0.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for bottle_restx-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4abd06468bd51baa1b040191d7ae073a57137ab3f73123eb7bcafcfbc8e0976 |
|
MD5 | 22105f88b8bcaa01e002ea574dfa6ea8 |
|
BLAKE2b-256 | 736b098d04bc02a85087fc338ae0635db042c1d57c050027edf81f415d90cdb7 |