Muffin – fast, lightweight, and asynchronous ASGI web framework for Python 3.11+.
Documentation: https://klen.github.io/muffin
Why Muffin?
Muffin combines the simplicity of microframeworks with native ASGI performance, supporting multiple async libraries (Asyncio, Trio, Curio) out of the box. Its rich plugin ecosystem makes building modern web applications pleasant and efficient.
Key Features
ASGI compatible
Competitive performance (Benchmarks)
Multiple response types: text, HTML, JSON, streams, files, SSE, WebSockets
First-class plugin system for templating, databases, auth, and more
Installation
Muffin requires Python 3.11 or newer. We recommend using the latest stable Python.
Install via pip:
$ pip install muffin
For the standard installation with gunicorn, uvicorn, uvloop, httptools:
$ pip install muffin[standard]
Dependencies
These packages will be installed automatically:
ASGI-Tools – ASGI toolkit
Modconfig – hierarchical configuration manager
Quickstart
Create a simple “Hello User” app:
import muffin
app = muffin.Application()
@app.route('/', '/hello/{name}')
async def hello(request):
name = request.path_params.get('name', 'world')
return f'Hello, {name.title()}!'
Save this as example.py and run:
$ uvicorn example:app
Visit http://localhost:8000 or http://localhost:8000/hello/username in your browser.
Plugins
Muffin has a rich ecosystem of plugins:
muffin-jinja2 – Jinja2 templates (asyncio/trio/curio)
muffin-session – Signed cookie-based HTTP sessions
muffin-oauth – OAuth1/OAuth2 integration
muffin-sentry – Sentry error tracking
muffin-peewee-aio – Peewee ORM integration with async support
muffin-babel – Localization with Babel
muffin-databases – Async support for a range of databases
muffin-mongo – MongoDB integration
muffin-redis – Redis integration
muffin-rest – REST helpers
muffin-apiclient – Support for external APIs
muffin-grpc – GRPC support
muffin-kafka – Kafka integration
muffin-admin – Admin interface
muffin-prometheus – Prometheus metrics exporter
See each repo for usage and installation instructions.
Benchmarks
Performance comparisons are available at: http://klen.github.io/py-frameworks-bench/
Bug tracker
Found a bug or have a feature request? Please open an issue at: https://github.com/klen/muffin/issues
License
Muffin is licensed under the MIT license.
Credits
Muffin > 0.40 (completely rewritten on ASGI)
Muffin < 0.40 (based on AIOHTTP_)
Metadata
Release files for muffin 3.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| muffin-3.2.1.tar.gz | 13.8 kB | Without provenance | Details for muffin-3.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| muffin-3.2.1-py3-none-any.whl | Python 3 | none | any | Details for muffin-3.2.1-py3-none-any.whl |
Total release size: 30.7 kB
Release files / muffin-3.2.1.tar.gz
| Download URL | muffin-3.2.1.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c3caf054a40de9bffb06e4f7102c7adf9898626d925be477861c08291f8f2bc
|
|
BLAKE2b-256 checksum How to use checksums |
f07f94602cdda30b90f149b49b755c818c0d185a365f0bffa9d4b4cc75e377cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / muffin-3.2.1-py3-none-any.whl
| Download URL | muffin-3.2.1-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5cb9129a0d3c6fcb5745a8406bb7705a1ab6e4876673a503bc9b3f5353f6f972
|
|
BLAKE2b-256 checksum How to use checksums |
625867651bd96203afbc20a0cc13545cfb77d6084cfbb98c5a34edf3c42b1b85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for muffin 3.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.