Skip to main content

High-level async API client and scheduler framework

Project description

zf_rush - 高性能异步 API 客户端框架

特性

  • 🚀 异步并发请求支持
  • 🔄 自动重试机制
  • 🕶️ 代理池支持
  • 🔒 签名验证系统
  • 📦 易扩展架构

快速开始

pip install zf_rush

基础用法

from zf_rush import AppConfig, CacheData, Scheduler, RushClient

# 配置初始化
config = AppConfig(
    concurrency=10,
    max_requests=1000,
    request_delay=0.3
)

cache = CacheData(enabled=False)  # 禁用缓存

# 创建调度器
scheduler = Scheduler(
    app_config=config,
    cache_data=cache
)

# 启动任务
asyncio.run(scheduler.start())

高级用法

扩展配置

from zf_rush import AppConfig

class MyConfig(AppConfig):
    api_endpoint: str = "https://api.example.com"
    custom_timeout: int = 30

config = MyConfig()

自定义客户端

from zf_rush import BaseApiClient

class MyClient(BaseApiClient):
    async def perform_action(self, action: str, *args, **kwargs):
        if action == "custom":
            return await self._custom_method()
        return await super().perform_action(action, *args, **kwargs)

    async def _custom_method(self):
        # 自定义实现
        pass

贡献

欢迎提交 PR 和 Issue

  1. 模块化设计
  • 独立代理模块
  • 分离工具函数
  • 明确的模块职责划分
  1. 可扩展性
  • 基于继承的配置扩展
  • 可插拔的缓存系统
  • 开放的客户端/调度器接口
  1. 易用性
  • 类型提示完善
  • 灵活的配置选项
  • 详细的文档示例

是否需要针对某个具体模块的实现进行详细说明?或者需要补充其他功能的实现细节?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zf_rush-0.1.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zf_rush-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file zf_rush-0.1.2.tar.gz.

File metadata

  • Download URL: zf_rush-0.1.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zf_rush-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b88ba39a9fbd7e6b10b29edda01208238eed3b9781e5a1dab736e6733b3f36be
MD5 55624802ebe366c5263e127db7d1ddfa
BLAKE2b-256 33867b7bcbbf9e151a3df3815d8aa49afb914beea6b3c2640ca5c1d5d1588585

See more details on using hashes here.

File details

Details for the file zf_rush-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: zf_rush-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zf_rush-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af6c6f6f59be84ad345c221d1d42d15af2a4cd6bf3bb2e0ec00f4180248aee1c
MD5 56c8d96dbda2ce2d14ad6caf896752b9
BLAKE2b-256 558566e4ec4c890d3f5ee74f77bf8003214b5aba69bedf8d8fd197333b5277bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page