登录 注册
网络与基础设施 asgiasynciohttphttp-serverpython
11,094
Stars
1,093
Forks
93
Watchers
107
Open Issues
BSD-3-Clause
许可证
Python
语言
2017-05-31
创建时间
2026-11-01
最近更新

项目能做什么

一款极速、轻量级的 Python ASGI Web 服务器。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
<p align="center">
  <img width="320" height="320" src="https://raw.githubusercontent.com/Kludex/uvicorn/main/docs/uvicorn.png" alt='uvicorn'>
</p>

<p align="center">
<em>An ASGI web server, for Python.</em>
</p>

---

[![Build Status](https://github.com/Kludex/uvicorn/workflows/Test%20Suite/badge.svg)](https://github.com/Kludex/uvicorn/actions)
[![Package version](https://badge.fury.io/py/uvicorn.svg)](https://pypi.python.org/pypi/uvicorn)
[![Supported Python Version](https://img.shields.io/pypi/pyversions/uvicorn.svg?color=%2334D058)](https://pypi.org/project/uvicorn)
[![Discord](https://img.shields.io/discord/1051468649518616576?logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/RxKUF5JuHs)

---

**Documentation**: [https://uvicorn.dev](https://uvicorn.dev)

**Source Code**: [https://www.github.com/Kludex/uvicorn](https://www.github.com/Kludex/uvicorn)

---

Uvicorn is an ASGI web server implementation for Python.

Until recently Python has lacked a minimal low-level server/application interface for
async frameworks. The [ASGI specification][asgi] fills this gap, and means we're now able to
start building a common set of tooling usable across all async frameworks.

Uvicorn currently supports HTTP/1.1, HTTP/2 and WebSockets.

## Quickstart

Install using `pip`:

```shell
$ pip install uvicorn
```

This will install uvicorn with minimal (pure Python) dependencies.

```shell
$ pip install 'uvicorn[standard]'
```

This will install uvicorn with "Cython-based" dependencies (where possible) and other "optional extras".

In this context, "Cython-based" means the following:

- the event loop `uvloop` will be installed and used if possible.
- the http protocol will be handled by `httptools` if possible.

Moreover, "optional extras" means that:

- the websocket protocol will be handled by `websockets` (should you want to use `wsproto` you'd need to install it manually) if possible.
- the `--reload` flag in development mode will use `watchfiles`.
- `python-dotenv` will be installed should you want to use the `--env-file` option.
- `PyYAML` will be installed to allow you to provide a `.yaml` file to `--log-config`, if desired.

Create an application, in `example.py`:

```python
async def app(scope, receive, send):
    assert scope['type'] == 'http'

    await send({
        'type': 'http.response.start',
        'status': 200,
        'headers': [
            (b'content-type', b'text/plain'),
        ],
    })
    await send({
        'type': 'http.response.body',
        'body': b'Hello, world!',
    })
```

Run the server:

```shell
$ uvicorn example:app
```

---

## Why ASGI?

Most well established Python Web frameworks started out as WSGI-based frameworks.

WSGI applications are a single, synchronous callable that takes a request and returns a response.
This doesn’t allow for long-lived connections, like you get with long-poll HTTP or WebSocket connections,
which WSGI doesn't support well.

Having an async concurrency m
阅读完整原文

商业机会分析 AI 生成

ASGI/FastAPI 专属性能诊断与 APM 平台 (SaaS/On-Premise)

产品构想针对基于 Uvicorn/FastAPI 的应用,提供无侵入的事件循环(uvloop/asyncio)阻塞检测、慢请求追踪及内存泄漏分析探针工具。
核心功能uvloop 阻塞监测告警、异步调用链路追踪(Trace)、协程泄露定位、针对 Uvicorn 进程池的资源可视化大屏。
目标用户使用 FastAPI/Uvicorn 跑高并发业务的后端工程师、SRE 团队。
难度/周期高 · 3-6个月 · 成本:中等(主要是云端接收分析数据的服务器成本与测试基础设施)
收费模式按受监控节点/进程数月费订阅(Freemium 模式,按节点数阶梯计费)。
竞争风险市场上已有 Datadog/Sentry 等成熟 APM 产品,需深度绑定 ASGI/asyncio 独有痛点形成差异化,壁垒要求高。
依据 数据支持的判断

Uvicorn 企业级进程管理与集群部署网关 (Enterprise Control Plane)

产品构想补足生产环境单机或小型集群部署中 Uvicorn 缺乏商业级进程管理、零停机平滑热重载、自动化 TLS 证书轮换及灰度发布管理控制台。
核心功能平滑无损热重启 (Zero-downtime reload)、动态流量负载均衡、集成 ACME 自动 SSL/TLS、Web 管理后台控制面板、崩溃自愈与日志聚合。
目标用户中小型企业运维人员、没有专职 K8s 运维团队的中小团队。
难度/周期中等 · 2-3个月 · 成本:低(轻量控制面架构开发)
收费模式核心开源,高级管理后台/多节点集群管理功能采用商业源码许可证 (BSL) 或企业版年费订阅。
竞争风险Kubernetes 生态成熟,许多企业通过 K8s 原生机制解决进程管理和流量调度,目标受众集中在非 K8s 用户群。
依据 尚需验证的假设

面向高合规要求的企业级 Uvicorn 发行版与商业支持服务

产品构想提供加固型 Uvicorn 商业支持版,包含预编译的安全 C/Cython 拓展、FIPS 兼容的 TLS 栈、SLA 漏洞修复与性能调优咨询服务。
核心功能CVE 漏洞优先修复与反向移植支持、FIPS 合规组件包、极速响应的商业 SLA、一对一生产架构/性能压测调优咨询。
目标用户金融科技、医疗健康、政府相关等对合规和漏洞修复 SLA 有硬性要求的大型企业采购方。
难度/周期中等 · 1-2个月 · 成本:低(主要是人力与合规测试环境成本)
收费模式按年度支持合约(Commercial Support Contract)收费,提供 Tier-1/Tier-2 技术支持等级与定制咨询费。
竞争风险依赖销售人脉与品牌信任度,独立开发者或新团队难以在大型企业中获取采购资质,成单周期极长。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
sanic-org/sanic 中文介绍暂未生成
Accelerate your web app development | Build fast. Run fast
18,631 Python
Kludex/starlette 中文介绍暂未生成
The little ASGI framework that shines. 🌟
12,725 Python
simonw/datasette 中文介绍暂未生成
An open source multi-tool for exploring and publishing data
11,582 Python
falconry/falcon 中文介绍暂未生成
The no-magic web API and microservices framework for Python
9,814 Python
litestar-org/litestar 中文介绍暂未生成
Light, flexible and extensible ASGI framework | Built to sca
8,547 Python
emmett-framework/granian 中文介绍暂未生成
A Rust HTTP server for Python applications
5,779 Rust
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2017-05-31,近 30 天仍在推送,发布过 90 个 Release
社区活跃Star 11,094 / Fork 1,093 / Issue 107(数据支持,可自行核实)
许可证BSD-3-Clause
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/Kludex/uvicorn.git
cd uvicorn
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。