HsxWorkFlow 内置 Redis 操作封装,提供缓存、队列、计数等功能。
概览
RedisHandler
RedisHandler 是 Redis 操作的封装类。
获取 Redis 处理器
from hsxworkflow.Utils.redis_handler import get_redis_handler
rdb = get_redis_handler()
2026/3/20大约 3 分钟
HsxWorkFlow 内置 Redis 操作封装,提供缓存、队列、计数等功能。
RedisHandler 是 Redis 操作的封装类。
from hsxworkflow.Utils.redis_handler import get_redis_handler
rdb = get_redis_handler()
HsxWorkFlow 集成 DrissionPage 实现浏览器自动化操作,支持 Chromium 的页面操作、数据抓取等功能。
DriverClient 是 DrissionPage 的客户端封装类。
from hsxworkflow.DP.DPClient import DriverClient
driver = DriverClient()
HsxWorkFlow 基于 pydantic-settings 实现类型安全的配置管理,支持环境变量、.env 文件和代码内默认值。
AppConfig # 主配置(WORKFLOW_ 前缀)
├── debug: bool # 调试模式
├── environment: str # 运行环境
├── max_workers: int # 线程池大小
├── default_time_interval: float # 执行间隔
├── database: DatabaseConfig # 数据库配置(DB_ 前缀)
│ ├── host: str
│ ├── port: int
│ ├── user: str
│ ├── password: str
│ ├── database: str
│ ├── charset: str
│ └── url: str (property)
├── redis: RedisConfig # Redis 配置(REDIS_ 前缀)
│ ├── host: str
│ ├── port: int
│ ├── password: str
│ ├── db: int
│ ├── max_connections: int
│ └── url: str (property)
├── log: LogConfig # 日志配置(LOG_ 前缀)
│ ├── level: str
│ ├── dir: str
│ ├── format: str
│ ├── max_bytes: int
│ └── backup_count: int
├── quantity_detection: QuantityDetectionConfig # 数量检测(QD_ 前缀)
│ ├── enabled: bool
│ ├── max_count: int
│ ├── slow_down_seconds: float
│ ├── break_on_limit: bool
│ └── redis_key_prefix: str
└── web: WebConfig # Web 配置(WEB_ 前缀)
├── host: str
├── port: int
├── debug: bool
├── cors_origins: list[str]
└── docs_enabled: bool