Base 26 Encoder and Decoder
Project description
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.
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
b26-0.0.1.tar.gz
(4.3 kB
view details)
Built Distribution
b26-0.0.1-py3-none-any.whl
(2.6 kB
view details)
File details
Details for the file b26-0.0.1.tar.gz
.
File metadata
- Download URL: b26-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36f110d67206c40f1aed9b3b783eaaa2ff3c404335fbf1ac555063439ea2bdb |
|
MD5 | a833657d2a4e1a7e7e550b1fa259acb4 |
|
BLAKE2b-256 | 8ca20e024cddea26f2b43eb078bc413b1b6b026dea14dd302a27901355a0f459 |
File details
Details for the file b26-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: b26-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cee429584a05778836d15628c96254dfde39cf26833794ea9a88584d3e677319 |
|
MD5 | 5df06c686845144315e225a5f5542100 |
|
BLAKE2b-256 | e4902b4fdaf231c3db9d6fb45a6d7a2331d2fcf8c4860dc12edad530e1c4ab70 |