An easy-to-use high-performance asynchronous web framework.
Project description
Index.py 实现了 ASGI3 接口,并使用 Radix Tree 进行路由查找。是最快的 Python web 框架之一。一切特性都服务于快速开发高性能的 Web 服务。
- 灵活且高效的路由系统 (基于 Radix Tree)
- 自动解析请求 & 生成文档 (基于 pydantic)
- 可视化 API 接口 (基于 ReDoc, 针对中文字体优化)
- 自带一键部署命令 (基于 uvicorn 与 gunicorn)
- 挂载 ASGI/WSGI 应用
- 进程内后台任务 (基于 asyncio)
- 可使用任何可用的 ASGI 生态
Install
pip install -U index.py
或者直接从 Github 上安装最新版本(不稳定)
pip install -U git+https://github.com/abersheeran/index.py@setup.py
中国大陆内的用户可从 Coding 上的镜像仓库拉取
pip install -U git+https://e.coding.net/aber/github/index.py.git@setup.py
Quick start
向 main.py
文件写入如下代码,使用 pip install index.py uvicorn
安装 uvicorn
和 index.py
,接下来执行 index-cli uvicorn main:app
就可以启动一个高效的 Web 服务了。
from indexpy import Index
from indexpy.routing import HttpRoute
async def homepage(request):
return "hello, index.py"
app = Index(
routes=[
HttpRoute("/", homepage, method="get"),
]
)
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.16.1.tar.gz
(40.2 kB
view hashes)
Built Distribution
index.py-0.16.1-py3-none-any.whl
(49.3 kB
view hashes)
Close
Hashes for index.py-0.16.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243a686a8cbfb2ba8805c21adaf1e560d1049d6972750c4f535ce560dcb5c50a |
|
MD5 | 4538e07a2dcad541df96bdc1ffb0f519 |
|
BLAKE2b-256 | e165db6c9994f88c36dbbf3e88ae6eb9b24be415a2680349a4abf4773c659b81 |