HTTP REST library including OOP-readiness and Open-API generation
Project description
Python HTTP REST library including OOP-readiness and Open-API generation
For a more comprehensive documentation see: https://restit.readthedocs.io/en/latest/
Features
WSGI conform
- Validation (using marshmallow)
query parameter validation
path parameter validation
request body validation
response body validation
OpenApi documentation generation
OOP-ready (no module-based global instances necessary)
Easy hyperlink generation
Exception mapping
Response serialization customization
Request deserialization customization
Easy to test
Quick example
from restit import Request, Resource, Response, RestItApp
from restit.decorator import path
@path("/")
class IndexResource(Resource):
def get(self, request: Request) -> Response:
return Response("Hello from index.")
app = RestItApp(resources=[IndexResource()])
if __name__ == "__main__":
# start a development server on http://127.0.0.1:5000
app.start_development_server()
You can also use a production-ready server like Gunicorn (given the name of the above module is restit_app_test.py):
gunicorn -w 4 restit_app_test:app
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
Built Distribution
File details
Details for the file restit-0.3.2.tar.gz
.
File metadata
- Download URL: restit-0.3.2.tar.gz
- Upload date:
- Size: 5.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4acdf359845526f2537ec5fed09949d195edb1b688864aae561d21417a0fa55 |
|
MD5 | 653d5eed016b7c306e563d6a6726b04f |
|
BLAKE2b-256 | 025c149ae37bfabfb2899693aecbeb4fbafcbcbb32f37e3d487e73373bb64a83 |
File details
Details for the file restit-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: restit-0.3.2-py3-none-any.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a4c4449a068a3b02d8f5f08f6554fab97ad3ce03d96bee31563b4724b92bc4b |
|
MD5 | e2aa1228c3fdfc5d4f7455e062879b2f |
|
BLAKE2b-256 | 824b9a5ea58cfd5272501a5ad315f81c61617f53787b69ae6dc89d01b6dae4ff |