--- id: roundrobin version: "0.1.0" license: MIT license_treatment: permissive maintenance: aging --- # roundrobin — Collection of roundrobin utilities License: permissive · Maintenance: aging · Downloads: 808.9K/mo ## What it is and what it does Roundrobin is a pure-Python library for selecting items in a cyclic, weighted, or smoothly-weighted distribution. It implements four selection strategies: basic round-robin cycles through items in order; weighted round-robin distributes picks proportionally to assigned weights (classic LVS algorithm); smooth weighted round-robin avoids clustering by spreading picks more evenly (Nginx-style); and smooth_stateful adds runtime controls to adjust weights, disable items, and enable slow-start ramping without restarting the schedule. The library is designed for load-balancing scenarios where you need to distribute requests or work across multiple backends or workers. It has no external dependencies and works across Python 2.7 and Python 3.4 through 3.15. The stateful variant is useful for health checks and dynamic capacity changes, though it is not thread-safe and requires external synchronization if shared across threads. Use it for: - Distribute HTTP requests across multiple backend servers with configurable weights and smooth distribution. - Implement health-check-aware load balancing by disabling unhealthy backends and re-enabling them with slow-start. - Balance work items across thread or process pools with weighted capacity allocation. - Rotate through a list of API endpoints or data sources in a predictable, weighted manner. - Implement slow-start ramp-up for newly added servers to avoid thundering-herd effects. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides four round-robin selection algorithms: basic (cyclic), weighted (LVS-style), smooth weighted (Nginx-style), and smooth weighted with runtime controls for health checks and slow-start. Yes, if you need round-robin selection with weighted or smooth distribution. The package is lightweight, dependency-free, and well-documented with clear examples. Maintenance is aging but stable; no known vulnerabilities. Not suitable for high-concurrency scenarios without external locking. Best fit for single-threaded or lock-protected use cases in load balancing, task distribution, or endpoint rotation. ## Install pip install roundrobin uv add roundrobin poetry add roundrobin ## Installing roundrobin Before you install: Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging (201 days since last release), but the repository remains active and the package has been stable since its first release in 2019. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source contexts. Quickstart: pip install roundrobin import roundrobin get_rr = roundrobin.basic(["A", "B", "C"]) print(get_rr()) # returns next item in cycle # Weighted variant get_weighted = roundrobin.weighted([("A", 5), ("B", 1)]) print(get_weighted()) # respects weight ratios # Smooth weighted with runtime control rr = roundrobin.smooth_stateful([("A", 5), ("B", 1)]) rr.disable("A") # remove from rotation rr.enable("A", effective_weight=0) # slow-start print(rr()) # returns next item Verify before relying: - Whether the package is actively maintained beyond bug fixes (last commit 2026-01-25, but no recent feature development signals). - Performance characteristics under high-frequency selection (throughput, latency per call). - Whether smooth_stateful's state management scales well with many items or frequent weight changes. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 808.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags round robin selector, weighted load balancing, smooth round robin, nginx-style balancing, lvs weighted distribution, runtime weight adjustment, health check balancing, load-balancing, scheduling, stateful-selection [View on SkillFed](https://skillfed.io/packages/roundrobin) · [View on PyPI](https://pypi.org/project/roundrobin/)