FastAPI-Nacos-Extension v0.1.1
中文
面向 FastAPI 与 Nacos 2.x 的生产级集成插件。
主要功能
- 支持服务自动注册、优雅注销及生命周期故障恢复。
- 提供服务发现、集群与 metadata 过滤,以及
first、random、weight选择策略。 - 支持按 Data ID 和 Group 读取配置中心原始文本。
- 同时提供异步接口和对应的
_sync同步接口。 - 支持多应用、多进程及 Uvicorn/Gunicorn Worker。
- 提供本地状态查询和可选的
/health/nacos健康检查。 - 包含有限重试、日志脱敏及 fork 后运行时重建。
- 使用 Apache License 2.0。
兼容范围
Python >=3.8 · FastAPI >=0.112.2,<1.0.0 · nacos-sdk-python >=2.0.0,<3.0.0 · Nacos Server 2.3.2
English
A production-oriented FastAPI integration for Nacos 2.x.
Highlights
- Automatic registration, graceful deregistration, and lifecycle recovery.
- Service discovery with cluster and metadata filters.
first,random, andweightinstance-selection strategies.- Raw configuration reads by Data ID and Group.
- Matching asynchronous and
_syncsynchronous APIs. - Multi-application, multi-process, and Uvicorn/Gunicorn worker support.
- Local status reporting and optional
/health/nacosendpoint. - Finite retries, sanitized logging, and post-fork runtime reconstruction.
- Licensed under Apache License 2.0.
Compatibility
Python >=3.8 · FastAPI >=0.112.2,<1.0.0 · nacos-sdk-python >=2.0.0,<3.0.0 · Nacos Server 2.3.2
Installation
pip install fastapi-nacos-extension==0.1.1