An easy-to-use asynchronous web framework based on ASGI.
Project description
Index.py 实现了 ASGI3 接口,并使用 Radix Tree 进行路由查找。是最快的 Python web 框架之一。一切特性都服务于快速开发高性能的 Web 服务。
- 灵活且高效的路由系统 (基于 Radix Tree)
- 自动解析请求 & 生成文档 (基于
pydantic
) - 可视化 API 接口 (基于
ReDoc
, 针对中文字体优化) - 非常简单的部署 (基于
uvicorn
与gunicorn
) - 挂载 ASGI/WSGI 应用 (基于 a2wsgi)
- 进程内后台任务 (基于
asyncio
) - 可使用任何可用的 ASGI 生态
Install
pip install -U index.py
或者直接从 Github 上安装最新版本(不稳定)
pip install -U git+https://github.com/abersheeran/index.py@setup.py
Quick start
向一个 .py
文件写入如下代码并直接执行它,访问 http://127.0.0.1:4190
。
from indexpy import Index
app = Index()
@app.router.http("/", method="get")
async def homepage(request):
return "hello, index.py"
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, interface="asgi3", port=4190)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
index.py-0.12.5.tar.gz
(36.3 kB
view hashes)
Built Distribution
index.py-0.12.5-py3-none-any.whl
(44.0 kB
view hashes)
Close
Hashes for index.py-0.12.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f22cf3bd53d0209ba968d2a563ee3d6e3e7d6cd7a48a395a2ef02136d2ec9f7f |
|
MD5 | 1b84b72bab5372720586a80ed733f0c4 |
|
BLAKE2b-256 | 48a8b8ba335f5c0d2f21b1d25cb71d581e8d2c9c4bca54261763fbf6c6ea014e |