ASGI-Tools Documentation#
Lightweight, high-performance ASGI toolkit for modern Python async apps.
Overview#
ASGI-Tools is a minimal, extensible ASGI toolkit designed to help you build async Python applications faster and more efficiently.
Key Features#
Async Support – Seamless integration with Asyncio, Trio, and Curio
High Performance – Optimized for speed and minimal resource usage
Rich Request Handling – Powerful
Request
supporting headers, cookies, forms, and file uploadsFlexible Responses – Multiple response types: HTTP, static files, streaming, SSE, WebSocket via
Response
- Built-in Middleware – Essential middleware for common patterns:
RequestMiddleware
– Request parsingResponseMiddleware
– Response handlingRouterMiddleware
– URL routingLifespanMiddleware
– Application lifecycleStaticFilesMiddleware
– Static file serving
Testing Support – Built-in test client with WebSocket support via
ASGITestClient
Simple Application Builder – Quick-start with
App
Installation#
Install ASGI-Tools with pip:
pip install asgi-tools
Quick Start#
Here’s a minimal example to get you started:
from asgi_tools import App
app = App()
@app.route("/")
async def hello(request):
return "Hello, World!"
Run it with an ASGI server like uvicorn:
uvicorn app:app
Visit http://127.0.0.1:8000/ to see your application running!
Documentation Overview#
Installation – Install and set up ASGI-Tools
Usage – Learn how to use ASGI-Tools effectively
API Reference – Detailed API reference
User’s Guide#
API Reference#
For detailed information on functions, classes, and methods:
Contributing#
ASGI-Tools is an open source project. Contributions, issues, and feature requests are welcome!
GitHub: klen/asgi-tools
Report Issues: klen/asgi-tools#issues