A package that finds range intersections
Project description
Intersectlib is a package I created to help with code that contains range intersections.
To install it run: pip install intersectlib
This package comes with the following features:
Find intersections between ranges: find_intersections()
Find a list with remainders after the intersection is removed: find_remainders()
Find both of the above: find_intersection_and_remainders()
Find and transform the intersection with a provided amount: transform_intersection()
Examples:
find_intersection((2, 10), (2, 5)) >> (2, 5)
find_remainders(range(2, 10), range(2, 5)) >> [(5, 10)]
find_remainders((2, 20), (8, 12)) >> [(2, 8), (12, 20)]
find_intersection_and_remainders((2, 10), (2, 5)) >> (2, 5), [(5, 10)]
transform_intersection((2, 10), (2, 5), 5) >> (2, 5) + 5 >> (7, 12)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for intersectlib-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf0822dadb5d9be4d88b2cfc836b7dd3bfa438f576c453605ea8317591c6289 |
|
MD5 | b809fadfd95d5728f9568e2c3b43a666 |
|
BLAKE2b-256 | 2d94a0f926f1353fb3f06d08bb67273d670b9916eadc265347a5d05a8e44b4a7 |