intersectlib


Nameintersectlib JSON
Version 1.3.2 PyPI version JSON
download
home_page
SummaryA package that finds range intersections and remainders
upload_time2024-01-04 15:40:43
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords destinations intersections ranges remainders sources
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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

```bash
pip install intersectlib
```
    
## Usage/Examples

```python

# find the intersection between two ranges
find_intersections(source: tuple | range, destination: tuple | range)

find_intersections((2, 10), range(5, 12)) >> (5, 10)
find_intersections((2, 10), (20, 30)) >> None

# find the remainders when the intersection is removed
find_remainders(source: tuple | range, destination: tuple | range)

find_remainders((2, 10), range(5, 12)) >> [(2, 5), (10, 12)]
find_remainders((2, 10), (1, 12)) >> []

# both of the functions above
find_intersection_and_remainders(source: tuple | range, destination: tuple | range)
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: tuple | range, destination: tuple | range, value_to_add: int)
transform_new_intersection((2, 10), range(5, 12), 5) >> (10, 15)

# transform an already existing intersection
transform_existing_intersection(intersection: tuple | range, value_to_add: tuple | range)

transform_existing_intersection((5, 10), 5) >> (10, 15)
transform_existing_intersection((5, 10), -3) >> (2, 7)
```


## Authors

- [@Rducker](https://github.com/Rducker0208)


## Support

For support:
- email duckerricardo@gmail.com.
- message me on discord: randomduck08
- post an issue at: https://github.com/Rducker0208/intersectlib/issues


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "intersectlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "destinations,intersections,ranges,remainders,sources",
    "author": "",
    "author_email": "Ricardo Ducker <duckerricardo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/51/58412b624cc680d02d54929fa9225a09ad9cfd847a2622078e03f693b72a/intersectlib-1.3.2.tar.gz",
    "platform": null,
    "description": "\n# intersectlib\n\nintersectlib is a library created to find intersections and remainders between two ranges and transform those.\n\n## Features\n\n- Find range intersections\n- Find remaining source\n- Transform intersections\n\n\n## Installation\n\nInstall intersectlib using pip\n\n```bash\npip install intersectlib\n```\n    \n## Usage/Examples\n\n```python\n\n# find the intersection between two ranges\nfind_intersections(source: tuple | range, destination: tuple | range)\n\nfind_intersections((2, 10), range(5, 12)) >> (5, 10)\nfind_intersections((2, 10), (20, 30)) >> None\n\n# find the remainders when the intersection is removed\nfind_remainders(source: tuple | range, destination: tuple | range)\n\nfind_remainders((2, 10), range(5, 12)) >> [(2, 5), (10, 12)]\nfind_remainders((2, 10), (1, 12)) >> []\n\n# both of the functions above\nfind_intersection_and_remainders(source: tuple | range, destination: tuple | range)\nfind_intersection_and_remainders((2, 10), range(5, 12)) >> (5, 10), [(2, 5), (10, 12)]\n\n# find a new intersection and transform it\ntransform_new_intersection(source: tuple | range, destination: tuple | range, value_to_add: int)\ntransform_new_intersection((2, 10), range(5, 12), 5) >> (10, 15)\n\n# transform an already existing intersection\ntransform_existing_intersection(intersection: tuple | range, value_to_add: tuple | range)\n\ntransform_existing_intersection((5, 10), 5) >> (10, 15)\ntransform_existing_intersection((5, 10), -3) >> (2, 7)\n```\n\n\n## Authors\n\n- [@Rducker](https://github.com/Rducker0208)\n\n\n## Support\n\nFor support:\n- email duckerricardo@gmail.com.\n- message me on discord: randomduck08\n- post an issue at: https://github.com/Rducker0208/intersectlib/issues\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A package that finds range intersections and remainders",
    "version": "1.3.2",
    "project_urls": {
        "Homepage": "https://github.com/Rducker0208/intersectlib",
        "Issues": "https://github.com/Rducker0208/intersectlib/issues"
    },
    "split_keywords": [
        "destinations",
        "intersections",
        "ranges",
        "remainders",
        "sources"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "195d90add27536e14e209e6b54245dfaa0c59f6841d5ff329eb56f2fb9c7436b",
                "md5": "75561bd96156606bf15a19db2a6e5a81",
                "sha256": "b089bb302d2339b298076ad237718f98742f6f6621407de339a638b3536a5432"
            },
            "downloads": -1,
            "filename": "intersectlib-1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75561bd96156606bf15a19db2a6e5a81",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4094,
            "upload_time": "2024-01-04T15:40:40",
            "upload_time_iso_8601": "2024-01-04T15:40:40.792041Z",
            "url": "https://files.pythonhosted.org/packages/19/5d/90add27536e14e209e6b54245dfaa0c59f6841d5ff329eb56f2fb9c7436b/intersectlib-1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "905158412b624cc680d02d54929fa9225a09ad9cfd847a2622078e03f693b72a",
                "md5": "1992ca949cc6a1770dc7825fde79594c",
                "sha256": "2b777e23c77700310d44b9d325641d1bdb80c2042ef1baf97ac5f677061e21a3"
            },
            "downloads": -1,
            "filename": "intersectlib-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1992ca949cc6a1770dc7825fde79594c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3327983,
            "upload_time": "2024-01-04T15:40:43",
            "upload_time_iso_8601": "2024-01-04T15:40:43.314914Z",
            "url": "https://files.pythonhosted.org/packages/90/51/58412b624cc680d02d54929fa9225a09ad9cfd847a2622078e03f693b72a/intersectlib-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-04 15:40:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Rducker0208",
    "github_project": "intersectlib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "intersectlib"
}
        
Elapsed time: 0.16567s