A package that finds range intersections and remainders
Project description
intersectlib
intersectlib is a library created to find intersections and remainders between two ranges and transform those.
Features
- Find range intersections
- Find remaining source
- Transform intersections
Installation
Install intersectlib using pip
pip install intersectlib
Usage/Examples
source: tuple / range
destination: tuple / range
value_to_add: int
intersection: tuple
remainders: list of tupples
# find the intersection between two ranges
find_intersections(source, destination)
find_intersections((2, 10), range(5, 12)) >> (5, 10)
# find the remainders when the intersection is removed
find_remainders(source, destination)
find_remainders((2, 10), range(5, 12)) >> [(2, 5), (10, 12)]
# both of the functions above
find_intersection_and_remainders(source, destination)
find_intersection_and_remainders((2, 10), range(5, 12)) >> (5, 10), [(2, 5), (10, 12)]
# find a new intersection and transform it
transform_new_intersection(source, destination, value_to_add)
transform_new_intersection((2, 10), range(5, 12), 5) >> (10, 15)
# transform an already existing intersection
transform_existing_intersection(intersection, value_to_add)
transform_existing_intersection((5, 10), 5) >> (10, 15)
transform_existing_intersection9=((5, 10), -3) >> (2, 7)
Authors
Support
For support:
- email duckerricardo@gmail.com.
- message me on discord: randomduck08
- post an issue at: https://github.com/Rducker0208/intersectlib/issues
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
intersectlib-1.3.1.tar.gz
(3.3 MB
view details)
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.3.1.tar.gz.
File metadata
- Download URL: intersectlib-1.3.1.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 |
729028400057e0ce6285d1854ad765464f9e2a1e99a08284cd959dfcc8175dc6
|
|
| MD5 |
00602b1d4cbe0e4fe3acdfced876609d
|
|
| BLAKE2b-256 |
45a9292aa210bbc525edbb39b57f55c8eeb1bdba1ec429709245542205cb0676
|
File details
Details for the file intersectlib-1.3.1-py3-none-any.whl.
File metadata
- Download URL: intersectlib-1.3.1-py3-none-any.whl
- Upload date:
- Size: 4.0 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 |
e2e4b61d53db6447db45f6a90382a50d7b826620e78c2cee22b13e290fd3dc94
|
|
| MD5 |
8f9ef05d9c37aaba6c7bdf0f89bf702a
|
|
| BLAKE2b-256 |
aba8a60954ace27162c6ef4f50f0b4e403064637e254da7a2ce830d4b05cc46d
|