Skip to main content

Flask-Lan is a schema validator and swagger generator but more modernized

Project description

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 swagger docs.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-lan-0.1.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

flask_lan-0.1.3-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page