python-ranges
Continuous Range, RangeSet, and RangeDict data structures
Decision gist · record as of 2026-08-14
Yes, if you need range data structures and can accept abandoned maintenance. The package is stable, has no known vulnerabilities, and solves a real problem with clean syntax. However, do not rely on it for active bug fixes or compatibility updates beyond Python 3.9. It is suitable for self-contained projects where you control the Python version and can tolerate no future support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or higher.
- Low install friction with no runtime dependencies.
- However, the project is abandoned—last commit was 2023-07-25 and no releases since 2023-02-15.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute this package freely with minimal restrictions.
last release 2023-02-15 (1276 days) · last repo commit 2023-07-25 · 101 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 77,689 downloads/mo, #14,505 on PyPI
Alternatives
Verify before relying
pip install python-ranges
from ranges import Range, RangeDict
# Check membership
if 5 in Range(1, 10):
print("Value in range")
# Use ranges as dictionary keys
tax_brackets = RangeDict({
Range(0, 9701): 0.10,
Range(9701, 39476): 0.12,
})
rate = tax_brackets[15000]- Whether the package handles edge cases with non-numeric types (strings, dates) as thoroughly as the description suggests.
- Performance characteristics when working with very large ranges or RangeSets.
- Compatibility with Python versions after 3.9, given the abandoned maintenance status.
What it is and what it does
python-ranges fills a gap in Python's standard library by providing proper continuous range data structures. The built-in range() only works with integers and doesn't support continuous values like floats or dates. This package introduces Range (a single continuous interval), RangeSet (a collection of non-overlapping ranges), and RangeDict (a dictionary that uses ranges as keys). These structures let you replace verbose if/elif/else chains and boundary-checking logic with cleaner, more readable code. For example, instead of writing multiple conditional branches to determine which tax bracket an income falls into, you can use a RangeDict to map income ranges directly to tax calculations.
The Range class supports any comparable data type—numbers, strings, dates—and can represent bounded or unbounded intervals with inclusive or exclusive endpoints. RangeSet provides set-like operations (union, intersection, difference) on collections of ranges. The package has zero runtime dependencies and installs easily, but development has stalled since early 2023, so it receives no active maintenance or updates.
Use it for
- Implement tax bracket or tiered pricing logic by mapping income or price ranges to corresponding rates or fees.
- Validate user input by checking if a value falls within acceptable bounds using membership testing.
- Clamp numeric or comparable values to a range without verbose min/max nesting.
- Build interval-based queries or lookups where you need to find which range a value belongs to.
- Perform set operations on date ranges, version ranges, or other comparable intervals.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need range data structures and can accept abandoned maintenance.
The package is stable, has no known vulnerabilities, and solves a real problem with clean syntax. However, do not rely on it for active bug fixes or compatibility updates beyond Python 3.9. It is suitable for self-contained projects where you control the Python version and can tolerate no future support.
Install
python-ranges on PyPI
Before you install
Low install friction with no runtime dependencies. However, the project is abandoned—last commit was 2023-07-25 and no releases since 2023-02-15. Requires Python 3.9 or higher.
Requires Python 3.9 or higher.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install python-ranges
from ranges import Range, RangeDict
# Check membership
if 5 in Range(1, 10):
print("Value in range")
# Use ranges as dictionary keys
tax_brackets = RangeDict({
Range(0, 9701): 0.10,
Range(9701, 39476): 0.12,
})
rate = tax_brackets[15000]
Verify before relying
- Whether the package handles edge cases with non-numeric types (strings, dates) as thoroughly as the description suggests.
- Performance characteristics when working with very large ranges or RangeSets.
- Compatibility with Python versions after 3.9, given the abandoned maintenance status.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,276 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,689 / month, #14,505 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: python_ranges-1.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “continuous ranges python”
- python-rangesProvides Range, RangeSet, and RangeDict data structures for…
- ConfigSpaceConfigSpace defines and manipulates configuration spaces for…
- nidaqmxProvides a Python API to control and acquire data from National…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also intervals · infinity · portion · prices · uszipcode · multiset · orderly-set · python-stdnum · pipe · pyxlsx