Skip to main content

throttled-py

Weekly Pick

github.com

throttled-py 是一个高性能 Python 限流库,支持多种算法(固定窗口、滑动窗口、令牌桶、漏桶和 GCRA)及存储选项(Redis、内存),提供线程安全的后端和灵活的限流策略。

Developer Tools & APIsOpen source#rate-limiting#python#redis
Visit website
throttled-py preview

throttled-py 是一个功能强大的 Python 限流库,支持多种限流算法,包括固定窗口、滑动窗口、令牌桶、漏桶和通用信元速率算法(GCRA)。它提供线程安全的存储后端,支持 Redis(基于 Lua 实现限流算法)和内存(基于 threading.RLock,支持 Key 过期淘汰)。该库具有灵活的限流策略和配额设置 API,文档详尽,并支持装饰器模式。不同存储选项均有良好的性能,内存存储的限流 API 执行耗时约为 2.5 ~ 4.5 次 dict[key] += 1 操作,Redis 存储约为 1.06 ~ 1.37 次 INCRBY key increment 操作。安装简单,可通过 pip 安装。

More in Developer Tools & APIs

SolveHub

API for CAPTCHA and anti-bot tasks in authorized testing

Dev Tools ·

liarjs.dev

Scanner that cross-checks browser JavaScript fingerprint against network layer

Dev Tools ·

AntiBrow

Antidetect browser for managing multiple browser identities with real-device

Dev Tools ·

HostlessWP

Open source CLI to move WordPress to Cloudflare Workers

Dev Tools ·

deed.page

Permanent web hosting with an API for AI agents

Dev Tools ·

Rowflare

Open-source Airtable alternative running on your Cloudflare account

Dev Tools ·