Skip to main content

A Flask extension, inspired by FastAPI that uses Pydantic to provide easy-to-configure data validation for request parsing and response serialization.

Project description

jeroboam-logo

Flask-Jeroboam

English | Français

Use FastAPI's elegant parameter syntax in your Flask applications.

PyPI Python Version Download License Commit

Read the documentation at https://flask-jeroboam.readthedocs.io/ Coverage Tests pre-commit.ci status Ruff


Documentation: https://flask-jeroboam.readthedocs.io/

Source Code: https://github.com/jcbianic/flask-jeroboam


What is Flask-Jeroboam?

Flask-Jeroboam brings FastAPI's approach to Flask. If you like how FastAPI handles request parsing, response validation, and automatic docs—but you need Flask instead—this is for you.

It inspects your endpoint function signatures and handles validation, serialization, and OpenAPI docs automatically. It's just a thin layer connecting Flask to Pydantic the way FastAPI does.

Why Flask-Jeroboam?

You have existing Flask code — Refactoring to FastAPI isn't an option. Jeroboam is a drop-in extension.

You rely on Flask's ecosystem — Flask-SQLAlchemy, Flask-Login, Flask-Admin, and dozens of other extensions just work. FastAPI doesn't integrate with them.

You serve both HTML and APIs — Some apps need to render templates alongside JSON endpoints. Flask handles both naturally.

You prefer WSGI — Whether for infrastructure reasons or team preference, WSGI is your deployment model.

You want FastAPI's development experience — Type-safe endpoints with automatic documentation, without switching frameworks.

Key Features

  • Per-Parameter Validation — Type hints on endpoint arguments automatically validate and parse request data
  • Response Validation — Define response models; Jeroboam validates outgoing data matches the schema
  • Automatic OpenAPI Docs — Interactive API documentation generated automatically
  • Type Safety — Use Python type hints to make code clearer and catch bugs earlier
  • Drop-In Compatible — Works with existing Flask applications and extensions

Quick Install

$ pip install flask-jeroboam

Full setup guide with dependency management: Installation

A Taste

from flask_jeroboam import Jeroboam, InboundModel, OutboundModel
from typing import Optional

app = Jeroboam(__name__)

class WineQuery(InboundModel):
    page: int = 1
    search: Optional[str] = None

class WineOut(OutboundModel):
    name: str
    appellation: str

@app.get("/wines", response_model=list[WineOut])
def list_wines(query: WineQuery):
    return get_wines(query.page, query.search)

Query params are parsed and validated from the type hints. The response is filtered and serialized against WineOut. Hit /docs for the interactive OpenAPI interface.

Next Steps

New to Jeroboam? Start with the Getting Started guide.

Ready to build? Follow the Tutorial for a complete example.

Need specifics? Check the How-to Guides for common tasks.

Want deeper understanding? Read the Concepts section.

How Does It Compare?

Flask-Jeroboam sits at a specific point in the landscape—closer to FastAPI than to flask-openapi3 or flask-restx, but firmly in the Flask ecosystem.

Aspect Jeroboam flask-openapi3 FastAPI
Per-parameter hints ❌ (groups in models)
Response validation ✅ by default ⚠️ opt-in ✅ by default
Pydantic v2
Decorator composition
Flask compatible ❌ (separate framework)
Async/await ❌ (WSGI) ❌ (WSGI) ✅ (ASGI)

See the full Comparison Guide for in-depth analysis.

About the Name

A Jeroboam is a large wine bottle (5 litres in Bordeaux, 3 litres elsewhere) designed for fine wines that age well. The larger surface-area-to-volume ratio slows oxidation. Temperature stays more stable. They're built to last without degrading your wine.

The project aims for the same durability: an API that stays solid and reliable as it ages.

License

Distributed under the MIT License. Flask-Jeroboam is free and open source.

Issues

Found a bug or want to suggest a feature? Please file an issue using the available templates.

Credits

Inspired by @tiangolo's FastAPI.

Built on Flask and Pydantic—both excellent projects.

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_jeroboam-0.2.1.tar.gz (387.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_jeroboam-0.2.1-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file flask_jeroboam-0.2.1.tar.gz.

File metadata

  • Download URL: flask_jeroboam-0.2.1.tar.gz
  • Upload date:
  • Size: 387.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flask_jeroboam-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0cd16dcc63e6eafe9c2032c1945eebfb49ec44836a621ec01216622f4dbd9c7c
MD5 66a1293c72a92048e739a0520c9251ca
BLAKE2b-256 657fa12b74b5e60c175c6dd71ed7bfa1d47e0e5c23c04b04227a7015aa3c2abb

See more details on using hashes here.

File details

Details for the file flask_jeroboam-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: flask_jeroboam-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flask_jeroboam-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84c5adc199aa57d1cf7484ac82e1f1644a8aa3356a667cacfda6375f32938167
MD5 13380db892c9913d2dc480aa2dfc9cec
BLAKE2b-256 ddd23faca540dfc95585a9679b4676da044bd05082422c7de3e0db5e1655b3b4

See more details on using hashes here.

Supported by

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