Architecture of pallets/flask
pallets/flask is 128 source files holding 1,046 symbols across 5 modules, written mainly in Python, Makefile, Shell. The largest module is tests, with 41 files, and 7 files are entry points into the dependency graph.
How flask fits together
The src/flask directory holds the framework itself, including the application object, request handling, and the flask command. src/flask/app.py is the central file and defines the Flask application object, where routing and view execution are handled. src/flask/__init__.py is an entry point that exposes Flask for import, as the README example does with from flask import Flask. src/flask/__main__.py is another entry point for running the package as a module. src/flask/json is the JSON subsystem, which handles serialization and deserialization and routes helpers through the active application context when one is available. A WSGI server calls the application object, and the response it returns is sent back to the client.
Largest modules
- tests: 41 files and 5,700 lines of code
- src: 24 files and 7,005 lines of code
- examples: 19 files and 570 lines of code
- docs: 2 files and 96 lines of code
- .devcontainer: 1 file and 6 lines of code
Languages
By file count: Python 83 files, Makefile 1 file, Shell 1 file.
Documentation
Repowise documents flask in 72 pages generated from the source, 7 of them written explanations of the repository and its modules. Module guides include:
- src/flask: Flask Application Core
- src/flask/json: Flask JSON Subsystem
More on flask: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos