【python】web开发常用库

FastAPI

构建 API 的高性能 Web 框架

https://github.com/fastapi/fastapi

1
pip install fastapi

uvicorn

异步 Web 服务器,可用于运行 FastAPI 应用

https://github.com/Kludex/uvicorn

1
2
3
4
# --host 0.0.0.0 指定主机
# --port 80 指定端口
# --reload 开启自动重新加载
pip install uvicorn

pydantic

用于数据校验和数据模型管理的库, 安装 fastapi 会自动安装 pydantic

https://github.com/pydantic/pydantic

requests

用于HTTP请求的库

https://github.com/psf/requests

1
pip install requests

SQLAlchemy

python SQL 工具包和 ORM 库

https://github.com/sqlalchemy/sqlalchemy

1
pip install SQLAlchemy

sqlmodel

SQLModel 基于 SQLAlchemy 和 Pydantic 构建。它由 FastAPI 的作者制作,旨在完美匹配需要使用SQL 数据库的 FastAPI 应用程序。

1
pip install sqlmodel