Interval Kit provides small numeric interval helpers for Python developers working with schedules, ranges, or bounded values.
Fictional teaching fixture. This library, API, commands, and maintainers are assumed examples, not an installable package. See the fixture contract.
- Check whether two half-open intervals overlap.
- Treat touching endpoints consistently as non-overlapping.
- Reject reversed bounds with a clear error.
This fixture assumes Python 3.11+ and a local library checkout with package metadata. There is no published registry package.
Create an environment and install from that assumed checkout:
python -m venv .venv
. .venv/bin/activate
python -m pip install -e .The activation command is for a POSIX shell. Then try the assumed API:
from interval_kit import overlaps
print(overlaps((1, 5), (4, 8))) # TrueRepresent intervals as (start, end) tuples. The start is included; the end is excluded.
from interval_kit import overlaps
print(overlaps((1, 5), (5, 8))) # False: touching endpoints
print(overlaps((2, 2), (1, 4))) # False: empty intervalThe fixture assumes finite numeric bounds and raises ValueError when a start exceeds its end. Convert dates or other domain values before calling the helper.
After local installation, run the assumed checks:
python -m unittest discoverCover overlapping, disjoint, touching, empty, and reversed intervals when changing interval behavior. Keep examples consistent with those cases.
The fictional maintainers welcome bug reports and focused fixes. Discuss new interval operations before expanding the API, and include an example that explains the intended boundary behavior.
Report problems through the issue tracker (fixture). Include the input intervals, actual result, expected result, and Python version.
This fixture assumes MIT. The MIT license covers this example document; inspect the target library's own license when adopting the layout.
Created by the fictional Interval Kit maintainers. Replace this teaching attribution with the real project's documented credits.