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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file intersectlib-1.1.2.tar.gz.
File metadata
- Download URL: intersectlib-1.1.2.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c25f58559419cb5131a267d93d072318b4c03ff8b62b12655f93ff38ba3fb34
|
|
| MD5 |
aa8bbf7e7b1270d9d65051d55ffa7772
|
|
| BLAKE2b-256 |
b3b836807ce98053a433dd1c093fbe2eac951264db9329f87c22ab71cbfd5d5f
|
File details
Details for the file intersectlib-1.1.2-py3-none-any.whl.
File metadata
- Download URL: intersectlib-1.1.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85358468d093d1adfeef3d8a614293ea059f9509002d2e1b0e5b9a7199121051
|
|
| MD5 |
5f9f587ade77cf839a7904c4b069eb56
|
|
| BLAKE2b-256 |
510f2d9ce27f67877060c9761932e84322ee0e3d45ed1d885beee02a008c1b9b
|