Last updated:
0 purchases
b26 0.0.1
b26 - Base 26 Encoder and Decoder
A common example usage is alphabetical counting:
When 'Z' is reached, the next items will be 'AA',
'AB' and so on.
Installation
pip install b26
Basic Usage
import b26
for i, item in enumerate([
"Apples",
"Banana",
"Pineapple",
...,
]):
print(f"{b26.encode(i)}. {item}")
API
decode()
decode(string: str) -> int
Converts an alphabetical string into an integer.
Parameters
string
A string that only consists of ASCII letters to
convert into an integer.
encode()
encode(integer: int) -> str
Convert an integer into an alphabetical string.
Parameters
integer
A positive integer or 0 to convert into a
string.
Returns
An uppercase alphabetical string.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.