Flask-Lan
Flask-Lan is a schema validator and swagger generator but more modernized.
!!! Warning
Currently, `flask-lan` is still under active development(before verion 1.0.0). Don't use it in production.
It's kind of like the famous library FastAPI, bringing part of brilliant features of FastAPI to your Flask application.
For example, it uses Pydantic for Request/Response params validation and auto-generates swagger docs.
Feature
- Intuitive and easy to use.
- Use type hinting to validate request/response params.
- Auto-generate
swaggerdocs.
Quick start
pip install flask-lan
A simple example:
from flask import Flask
from pydantic import BaseModel
from flask_lan import validator, docs
app = Flask(__name__)
@docs(tag="books", desc="Get books")
@app.get("/books/<id>/")
@validator
def home(id:int, q: str, star: float=10):
return {"id":id, "q": q, "star": star}
if __name__ == "__main__":
app.run(debug=True)
License
This project is licensed under the terms of the MIT license.
Release files for Flask-Lan 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flask-lan-0.1.3.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_lan-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / flask-lan-0.1.3.tar.gz
| Download URL | flask-lan-0.1.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fca03a4c5a76f3dff93c0566e7bd467d00df4d19fcfbfc02e2c1a6f377feebfb
|
|
BLAKE2b-256 checksum How to use checksums |
09c1919d9f4b9f4b1406c35f88b45ca401ae87d1f0712ff735cb9ecd3754c0f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.5 Linux/5.15.0-1014-azure
|
Release files / flask_lan-0.1.3-py3-none-any.whl
| Download URL | flask_lan-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fef25779d31b1bfdc34a3f8f33f1afa0da0c001d8f5782f13d72c096534d2911
|
|
BLAKE2b-256 checksum How to use checksums |
86ad2a1c6612d0221718a659f5cc7c65caa3bda7293db32b9c02425af01a68a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.5 Linux/5.15.0-1014-azure
|