character-range v0.2

character-range does exactly what it says on the tin: Create a string or bytes range. For more information, see API references.

from character_range import (
   ByteMap, character_range, CharacterMap,
   string_range, bytes_range
)

print(list(character_range('a', 'z')))
# 'a', 'b', ..., 'y', 'z'

for element in string_range('aaa', 'aba', CharacterMap.ASCII_LOWERCASE):
   print(element)  # 'aaa', 'aab', ..., 'aay', 'aaz', 'aba'

for element in bytes_range(b'0', b'10', ByteMap.ASCII_LOWERCASE):
   print(element)  # b'0', b'1', ..., b'9', b'00', b'01', ..., b'09', b'10'

Installation

character-range is available on PyPI:

$ pip install character-range

API references