Microdot: a Flask-style async web framework small enough for microcontrollers
Mirror of https://code.miguelgrinberg.com/miguelgrinberg/microdot
At a glance
- What is it?
- Microdot is Miguel Grinberg's minimalistic Python web framework for CPython and MicroPython. This article covers its route API, zero dependency packaging, the optional features split out into extensions, and the planned work that has not shipped.
- Who is it for?
- Choose Microdot if you want Flask-like routes on a microcontroller or a small CPython service and can live without the heavier pieces of a full framework. Stay on something larger if you need pub/sub over WebSocket and SSE or OpenAPI generation, since both are still only roadmap items.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 10 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.
Star history
- miguelgrinberg/microdot2,159 ★ · +9
| Repository | 2026-10-11 | 2026-11-26 |
|---|---|---|
| miguelgrinberg/microdot | 2.2k | 2.2k |
9 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
A Flask-shaped route decorator on an async handler
Microdot is a minimalistic Python web framework inspired by Flask. The inspiration is visible in the smallest program the project shows:
from microdot import Microdot
app = Microdot()
@app.route('/')
async def index(request):
return 'Hello, world!'
app.run()Three things stand out in those lines. An application object is created from Microdot, and routes are attached with the @app.route decorator, the same shape a Flask user already knows. The handler is declared with async def and takes a request argument explicitly, instead of reaching for a global request object. And app.run() starts the server directly, with no separate command line launcher in the example.
The project's tagline is that this is the impossibly small web framework for Python and MicroPython. Smallness is the design goal, and the consequence shows up everywhere else in this article: what is included is deliberately short, and what is missing has to come from somewhere else.
One codebase has to run on CPython and on MicroPython
Given its small size, Microdot can run on systems with limited resources such as microcontrollers. Both standard Python (CPython) and MicroPython are supported, so the same file can be developed on a laptop and then copied to a board.
Packaging metadata shows how seriously the second target is taken. The pyproject.toml classifiers include Programming Language :: Python :: Implementation :: MicroPython next to Python 3, and the package description reads The impossibly small web framework for MicroPython, with CPython absent from that string. The project README is the one that names both interpreters. The requires-python value is >=3.8, so the CPython floor is Python 3.8.
The repository carries a typings/ folder alongside src/, and type hints were a roadmap item delivered in version 2.6. A framework aimed at devices with little memory and a framework with type hints pull in slightly different directions, and the folder split keeps annotation material out of the source tree that gets copied to hardware. The reader is left to verify how much of the extension set fits on a given board.
The dependency list in pyproject.toml is empty
In pyproject.toml the dependencies array has nothing in it. Installing the package pulls no other Python packages, which matters on a microcontroller where every extra file consumes flash and RAM, and which also keeps CPython installs free of version conflicts.
The build is plain setuptools. The build-system table requires setuptools>=61.2 with the setuptools.build_meta backend, and the package directory is mapped to src through the package-dir table. The find table is limited to src with namespaces set to false. zip-safe is false and include-package-data is true.
Optional dependencies are kept out of the runtime. A dev extra lists tox, and a docs extra lists sphinx, furo and pyjwt. The pyjwt entry sits in the docs extra, which suggests the documentation builds against code that uses JSON Web Tokens, but the repository material does not say which extension that is. The package is published on PyPI under the name microdot, and the README links the PyPI page, a change log in CHANGES.md and documentation on readthedocs. The README gives no install command, so use the PyPI page and the Documentation link for that.
Version 1 is unmaintained and the migration notes are the only bridge
The README splits its links in two. The current links point at the main branch, the change log and the readthedocs documentation. A second list is labelled as legacy version 1 of Microdot, with its own git tree at the v1 tag and its own documentation under en/v1.
The warning is direct: version 1 is no longer maintained, so you should consider migrating to version 2, and the README points to migration notes in the latest documentation. For someone who found an older tutorial or a pinned requirement, this is the main hazard. A search result might land on the version 1 documentation, and code written against it is not receiving fixes.
The releases make the gap concrete. v2.7.0 was published on 2026-09-18, v2.6.2 on 2026-05-12 and v2.6.1 on 2026-04-24. The repository was last pushed on 2026-09-19. Nothing in the pack records what changed between those releases, so the CHANGES.md file is the place to read before upgrading. The mirror on GitHub is not the canonical home either: the description says it mirrors code.miguelgrinberg.com, and the issue tracker listed in pyproject.toml lives there.
Features beyond the core arrived as roadmap items, each tagged with the version that added it
The roadmap lists planned features for both MicroPython and CPython, and four of the six now carry an Added in marker. Authentication support similar to Flask-Login arrived in version 2.1. Support for forms encoded as multipart/form-data was added in version 2.2. A CSRF protection extension came in version 2.5, and type hints in version 2.6.
Those are the pieces a Flask developer would otherwise reach for as separate packages, and the examples directory matches the list with auth, login, sessions, csrf, uploads and cors folders. Other folders cover sse, websocket, streaming, static, templates, tls, subapps, benchmark, gpio and hello, so each capability has a runnable sample.
Two roadmap entries have no version marker: a pub/sub mini-framework for WebSocket and SSE, and an OpenAPI integration similar to APIFairy for Flask. The first matters for anyone building live dashboards on a device, because the websocket and sse examples exist but the higher level pub/sub layer does not. The second matters for anyone who wants generated API documentation. Both are marked as planned in the README, and neither should be assumed to exist in 2.7.0.
Where the testing and tooling live in the repository
The top level shows a conventional Python project with some unusual extras. Source code is under src/, tests under tests/, and a run_tests.py script and a tox.ini sit at the root, which matches the tox entry in the dev extra. The libs/ and bin/ folders and a tools/ folder are also present, but their contents are not described, so avoid guessing what they hold.
Build automation lives in .forgejo/, not in a GitHub workflow folder, because the canonical forge is a Forgejo instance. A .readthedocs.yaml file configures the documentation build, and the docs/ folder holds the Sphinx sources that the docs extra installs furo and pyjwt for. MANIFEST.in controls what ends up in source distributions.
Governance files are all present: CODE_OF_CONDUCT.md, CONTRIBUTING.md and SECURITY.md, each linked from the README where relevant. The project is MIT licensed, and the pyproject.toml classifier agrees. Funding is requested through GitHub Sponsors, Patreon, Buy me a Coffee, thanks.dev and PayPal, with the README stating that the project relies on contributions from its users.
The README tells you what Microdot is, not how to install or run it on a board
The README is short. It shows the hello world program, the resource links, the roadmap and the sponsor list, and nothing else. That leaves several questions the reader has to answer from the linked documentation.
There is no install command, no instruction for copying files to a MicroPython device, no list of supported boards and no memory figure for the framework. A reader who wants to know how many kilobytes of RAM Microdot needs will not find a number here, and none should be assumed. The same goes for performance: the repository contains an examples/benchmark folder, but the results are not given.
The typical first question is what to do with the sample program. Save it as a Python file and run it with an interpreter, since app.run() starts the server. On a microcontroller the same steps apply through the MicroPython runtime, but the README does not walk through them. The Documentation link on readthedocs is where those steps live, and the version 2 pages are the ones to read. Anyone comparing Microdot with other small frameworks needs to run their own checks, as the README makes no comparison with any of them except the Flask resemblance.
Editorial conclusion
Choose Microdot if you want Flask-like routes on a microcontroller or a small CPython service and can live without the heavier pieces of a full framework. Stay on something larger if you need pub/sub over WebSocket and SSE or OpenAPI generation, since both are still only roadmap items. Before you start, make sure you are reading the version 2 documentation, because version 1 is no longer maintained.
Frequently asked questions
What is Microdot?
Microdot is a minimalistic Python web framework inspired by Flask. It is small enough to run on systems with limited resources such as microcontrollers, and it supports both CPython and MicroPython.
How to use Microdot?
Create an app with Microdot(), attach handlers with the @app.route decorator, write them as async functions that take a request, and call app.run(). The README shows this in a hello world program that returns the text Hello, world!
How to install Microdot?
The README gives no install command, but it links the package on PyPI under the name microdot and the full documentation on readthedocs. The package declares no dependencies and requires Python 3.8 or newer.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/miguelgrinberg-microdot)Star history chart for your README
[](https://hysenlabs.com/projects/miguelgrinberg-microdot)Was this useful?