A Flask extension, inspired by FastAPI that uses Pydantic to provide easy-to-configure data validation for request parsing and response serialization.
Project description
Flask-Jeroboam
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask_jeroboam-0.2.2.tar.gz.
File metadata
- Download URL: flask_jeroboam-0.2.2.tar.gz
- Upload date:
- Size: 390.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
444cd25219267b13ecfc9f952f6ef385d8b518ec90a5d890ca4b8797a6ebe0fd
|
|
| MD5 |
6e1bcc10e5ea55962272f0991062f2f7
|
|
| BLAKE2b-256 |
22950badf942ef40290dd90505a32fb409a6dd1a45813a47802fd51d4dfb4735
|
File details
Details for the file flask_jeroboam-0.2.2-py3-none-any.whl.
File metadata
- Download URL: flask_jeroboam-0.2.2-py3-none-any.whl
- Upload date:
- Size: 43.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1726dd11edd100363f90ef620df66646a382220c81cde0c194f789b8cd7e01ad
|
|
| MD5 |
b69e4242e54306f1196451e475aab822
|
|
| BLAKE2b-256 |
fc2bd08bd68af8314e3b7ebe12edb80acb909819f8c581263ffd917172b69f1d
|