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.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for bottle_restx-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a42d9f640ad14ce762ac8639ada3b04c0a4a63b9f21b0268f97c2e36cc8d789 |
|
MD5 | 9d0df6b61778fe18c4ebb479f8e0d82d |
|
BLAKE2b-256 | 54a771e175c12454695a8afd71175c23d06b3e9258b54e7ad3e13a0ea969fd1d |