This Python script provides two utility functions for working with number ranges:
expand_ranges: Converts a list of range strings into a list of individual numbers.collapse_ranges: Converts a list of individual numbers into a list of range strings.
No installation is required. Simply download the range_utils.py file and import it into your Python project.
To use the functions, import them from the range_utils.py file:
from range_utils import expand_ranges, collapse_ranges