--- id: intervals version: "0.9.2" license: BSD license_treatment: permissive maintenance: abandoned --- # intervals — Python tools for handling intervals (ranges of comparable objects). License: permissive · Maintenance: abandoned · Downloads: 245.2K/mo ## What it is and what it does intervals is a Python library for creating and working with mathematical intervals—ranges defined by lower and upper bounds with configurable inclusion rules. It supports multiple interval types (IntInterval, FloatInterval, DateInterval, DateTimeInterval, etc.) and allows you to define open intervals (excluding endpoints), closed intervals (including both), or half-open variants. You can initialize intervals via factory methods like closed(), open_closed(), or from string representations like '[1, 5]' or '1 - 5'. The library provides properties to query interval characteristics (length, radius, centre, whether it's degenerate or empty) and supports standard operations like containment checks and comparisons. Its single runtime dependency is infinity, a lightweight package for representing infinite bounds. The package is pure Python and installs with low friction, but has been abandoned since mid-2022, so it receives no maintenance or updates. Use it for: - Represent and validate time ranges or scheduling windows to check if a date falls within a booking or availability interval. - Define numeric ranges for data validation, filtering, or binning—for example, categorizing sensor readings into interval buckets. - Build interval trees or perform range queries to test membership, overlap, or containment of comparable values. - Parse and manipulate human-readable interval notation from configuration files or user input using from_string. - Model mathematical or scientific computations involving bounded domains, such as function domains or parameter ranges. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python classes for representing and manipulating intervals (ranges) of comparable objects with support for open, closed, and half-open bounds, and operations like intersection and containment checking. Yes, if you need straightforward interval arithmetic and can accept an unmaintained package. The library is stable for its core use case and has no known vulnerabilities. However, do not adopt it for new projects requiring long-term support or compatibility with future Python versions—the last commit was 2022-05-05 and no maintenance is expected. Suitable for legacy codebases or internal tools where you control the Python version. ## Install pip install intervals uv add intervals poetry add intervals ## Installing intervals Before you install: Low install friction with a pure-Python wheel. However, the package is abandoned—last commit was 2022-05-05 and no releases since 2021-07-02. While it has 108 repository stars, the lack of maintenance means bug fixes and compatibility updates are unlikely. License in practice: BSD license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute the package freely provided you include the license notice. Quickstart: pip install intervals from intervals import IntInterval interval = IntInterval.closed(1, 5) print(interval.lower, interval.upper) Verify before relying: - Whether the package works reliably with Python versions released after 2022 (last commit date). - Current compatibility with modern versions of the infinity dependency. ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 245.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags interval range handling, interval arithmetic, range operations python, bounded ranges, interval intersection, date range intervals, numeric range library, ranges, mathematics [View on SkillFed](https://skillfed.io/packages/intervals) · [View on PyPI](https://pypi.org/project/intervals/)