roundrobin
Collection of roundrobin utilities
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 on this page — 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
roundrobin on PyPI
pip
pip install roundrobinuv
uv add roundrobinpoetry
poetry add roundrobinInstalling 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 | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 201 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 808,897/month — #5,012 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: roundrobin-0.1.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
binpackingDistributes weighted items into bins using…
permissive · top 15,000 on PyPI
vllm-routerRoutes and load-balances requests across vLLM…
permissive · top 15,000 on PyPI
queuelibQueuelib provides in-memory and disk-persisted…
permissive · top 5,000 on PyPI
aws-cdk.aws-elasticloadbalancingProvides AWS CDK constructs for configuring and…
permissive · top 15,000 on PyPI
aws-cdk.aws-elasticloadbalancingv2Provides AWS CDK constructs for defining and…
permissive · top 15,000 on PyPI
DijkstarDijkstar implements Dijkstra's shortest-path…
permissive · top 15,000 on PyPI
concurrencytestRuns unittest test suites concurrently across…
copyleft · top 15,000 on PyPI
aws-cdk.aws-globalacceleratorProvides AWS CDK constructs to define and…
permissive · top 15,000 on PyPI
rushrush provides rate-limiting algorithms…
permissive · top 15,000 on PyPI
selectolaxselectolax is a fast HTML5 parser with CSS…
permissive · top 5,000 on PyPI