Skip to main content

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

intersectlib-1.2.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intersectlib-1.2.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file intersectlib-1.2.2.tar.gz.

File metadata

  • Download URL: intersectlib-1.2.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

Hashes for intersectlib-1.2.2.tar.gz
Algorithm Hash digest
SHA256 9002e199cc767e79cc98af13246960594f75333a76d878ac873e3d6df79b2d47
MD5 2838f558a07653cfcbffa940073e3101
BLAKE2b-256 9284e099ca0b44fba230411f11d30651a240845da1f1a9ce5fc93213dfc73734

See more details on using hashes here.

File details

Details for the file intersectlib-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: intersectlib-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for intersectlib-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 79ef31594a79922f114c125698861441ce0f6522544ffc8d4e5023c7f746e1d4
MD5 deef741945b7e940715fb1fb38b93c14
BLAKE2b-256 eda00054c4681161e7b4370658fcd7599881b223fd379c4615d68181e30c568a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page