Utilities for manipulating and converting Python ranges and boolean lists
Project description
rangeutils
rangeutils
is a Python package that provides utilities for converting, manipulating, and processing Python range
objects and boolean lists. This package includes a variety of functions to convert between boolean lists and ranges, merge adjacent ranges, find complementary ranges, and trim ranges based on specific conditions.
Features
- Convert lists to ranges: Convert
[start, end]
lists to Python range objects, with optional handling forNone
values. - Boolean list to ranges: Converts a boolean list to a list of range objects representing
True
or1
sequences. - Ranges to boolean list: Converts a list of ranges back to a boolean list of specified length.
- Flip ranges: Generate complementary ranges that are not covered by input ranges.
- Merge ranges: Merge ranges that are within a specified gap size.
- Trim ranges: Perform trimming on ranges based on length, percentage, or a specified trimming size.
Installation
You can install range_utils
using pip:
pip install range_utils
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rangeutils-0.1.0.tar.gz
(5.3 kB
view details)
Built Distribution
File details
Details for the file rangeutils-0.1.0.tar.gz
.
File metadata
- Download URL: rangeutils-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a23acf1d5af7d47e2009bb759ce25c01f73599f8c1617d40d74f9826f62536 |
|
MD5 | d4dc2a9a23c94849737e76fced6e202b |
|
BLAKE2b-256 | 7dbe998ed8d1a3c2f9267bc1408cb3465888e15f69bd4011931de615c7cd56af |
File details
Details for the file rangeutils-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: rangeutils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3be5fda0f0ec86a86b7dc92fbc8d80801983c642d6011d0093c9b83a498d20c |
|
MD5 | 59f2eb38663bee48dd6aee6e90a1cd71 |
|
BLAKE2b-256 | 7f9c3ec9f7ca57104c78f43502506f01bb9fab7e7fbb54f5ca20c4995dfda12c |