Skip to main content

Muffin

Muffin

Fast, lightweight, asynchronous ASGI web framework for Python 3.11+. Documentation: https://klen.github.io/muffin

Tests Docs PyPI Python versions

Why Muffin?

Muffin combines the simplicity of microframeworks with native ASGI performance, supporting multiple async libraries (Asyncio, Trio, Curio) out of the box. Its plugin ecosystem covers templating, databases, auth and more.

Key features:

  • ASGI compatible
  • Competitive performance
  • Supports Asyncio, Trio and Curio
  • Multiple response types: text, HTML, JSON, streams, files, SSE, WebSockets
  • First-class plugin system

Installation

Muffin requires Python 3.11 or newer. We recommend using the latest stable Python.

$ pip install muffin

For the standard installation with gunicorn, uvicorn, uvloop and httptools:

$ pip install muffin[standard]

Dependencies installed automatically:

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

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.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for muffin 3.5.0
File Size Uploaded Provenance Actions
muffin-3.5.0.tar.gz 14.4 kB Without provenance Details for muffin-3.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for muffin 3.5.0
File Interpreter ABI Platform Actions
muffin-3.5.0-py3-none-any.whl Python 3 none any Details for muffin-3.5.0-py3-none-any.whl

Total release size: 32.0 kB

Release files / muffin-3.5.0.tar.gz

Download URL muffin-3.5.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
da95813108ccee46c837692921de7479259b1583ab347b028c926d2d949b1bc3
BLAKE2b-256 checksum
How to use checksums
c1b13e00c15f65ae08b4ca141a94565cd9521b81cfaa250fb29f009d9cc57baf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.5.0-py3-none-any.whl

Download URL muffin-3.5.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82068ac960e32e79485cc7712685f4c87c674deb99e1edde5715919c250574fe
BLAKE2b-256 checksum
How to use checksums
ca0c58107d03a90a9460e4c9284c4229272541482db70a95cec37f5a0494fac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.5.0

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.

Release history Release notifications | RSS feed

This release

3.5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page