A Python library with good intentions for building REST APIs.
-
Elegant
RESTArt
follows the art of Flask. It tries to help you build REST APIs by writing simple, clean and Pythonic code. -
Light
Only the essentials for REST APIs are included, no assumptions are made for you. The frameworks, databases and the business logic are all up to you.
-
Flexible
Customizations and extensions are made easy. The limit is your imagination!
A RESTArt
resource is just a class:
# helloworld.py
from restart.api import RESTArt
from restart.resource import Resource
api = RESTArt()
@api.route(methods=['GET'])
class Greeting(Resource):
name = 'greeting'
def read(self, request):
return {'hello': 'world'}
Run the Greeting
resource as an API via command restart
:
$ restart helloworld:api
Consume the API now:
$ curl http://127.0.0.1:5000/greeting
{"hello": "world"}
Check out the documentation.