Teke is a lightweight ASGI framework that you can use to create fast async REST APIs with Python.
Python 3.10+
$ pip install teke
You'll also want to install an ASGI server, such as uvicorn, daphne, or hypercorn.
$ pip install "uvicorn[standard]"
example.py:
from teke import JsonResponse, Router, create_app
router = Router()
@router.route("/hello/<name>")
async def hello(connection, name):
return JsonResponse({"hello": name})
app = create_app(routers=[router])
Then run the application using Uvicorn:
$ uvicorn example:app
Run uvicorn with --reload
to enable auto-reloading on code changes.
For a more complete example, see exampleshere.
- WebSocket support
- Lifecycle hooks
- CORS middleware
teke depends on the following python packages:
- anyio
- uvloop
- Werkzeug