Replace all poe task runner usage with direct pytest/sphinx/ruff commands. Remove poethepoet dependency and [tool.poe.tasks] config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Responder: a familiar HTTP Service Framework for Python
Responder is powered by Starlette. View documentation.
Responder gets you an ASGI app, with a production static files server pre-installed,
Jinja templating, and a production webserver based on uvloop, automatically serving
up requests with gzip compression.
The async declaration within the example program is optional.
Testimonials
"Pleasantly very taken with python-responder. @kennethreitz at his absolute best." —Rudraksh M.K.
"ASGI is going to enable all sorts of new high-performance web services. It's awesome to see Responder starting to take advantage of that." — Tom Christie author of Django REST Framework
"I love that you are exploring new patterns. Go go go!" — Danny Greenfield, author of Two Scoops of Django
More Examples
See the documentation's feature tour for more details on features available in Responder.
Installing Responder
Install the most recent stable release:
pip install --upgrade responder
Alternatively, install directly from the repository:
pip install 'responder @ git+https://github.com/kennethreitz/responder.git'
Responder supports Python 3.9+.
The Basic Idea
The primary concept here is to bring the niceties from both Flask and Falcon and unify them into a single framework. You'll find a familiar API with a clean, Pythonic design.
- Setting
resp.textsends back unicode, while settingresp.htmlsends back HTML. - Setting
resp.mediasends back JSON/YAML (.text/.html/.contentoverride this). - Setting
resp.contentsends back bytes. - Use
resp.file("path")to serve files with automatic content-type detection. - Case-insensitive
req.headersdict. resp.status_code,req.method,req.url, and other familiar friends.
Features
- Flask-style route expressions with f-string syntax and type convertors
(
str,int,float,uuid,path). - HTTP method filtering:
@api.route("/data", methods=["GET"]). - Every request and response is passed into each view and mutated — including
response.mediafor JSON/YAML content negotiation. - Built-in test client powered by Starlette's TestClient.
- Mount other WSGI/ASGI apps at subroutes.
- Automatic gzip compression.
- Class-based views with
on_get,on_post,on_requestmethods. - GraphQL support via Graphene with
api.graphql(). - OpenAPI schema generation with interactive docs.
- Lifespan context managers for startup/shutdown.
- Custom exception handlers.
- Before-request hooks with short-circuit support.
- Cookie-based sessions.
- WebSocket support.
- Background tasks.
- Production uvicorn server built-in.
Development
See Development Sandbox.
Supported by
Special thanks to the kind people at JetBrains s.r.o. for supporting us with excellent development tooling.
