Index.py implements the ASGI3 interface and uses Radix Tree for route lookup. Is one of the fastest Python web frameworks. All features serve the rapid development of high-performance Web services.
- Flexible and efficient routing system (based on Radix Tree)
- Automatically parse requests & generate documents (based on pydantic)
- Visual API interface (based on ReDoc, optimized for fonts)
- Built-in deployment commands (based on uvicorn and gunicorn)
- Mount ASGI/WSGI applications
- Background tasks in process (based on asyncio)
- Any available ASGI ecosystem can be used
pip install -U index.py
or install the latest version from Github (unstable).
pip install -U git+https://github.com/abersheeran/index.py@setup.py
Write the following code to the main.py
file, use pip install index.py uvicorn
to install uvicorn
and index.py
, and then execute index-cli uvicorn main:app
to start an efficient Web service now.
from indexpy import Index
from indexpy.routing import HttpRoute
async def homepage(request):
return "hello, index.py"
app = Index(
routes=[
HttpRoute("/", homepage, method="get"),
]
)