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.
Metadata
Release files for b26 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| b26-0.0.1.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| b26-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / b26-0.0.1.tar.gz
| Download URL | b26-0.0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d36f110d67206c40f1aed9b3b783eaaa2ff3c404335fbf1ac555063439ea2bdb
|
|
BLAKE2b-256 checksum How to use checksums |
8ca20e024cddea26f2b43eb078bc413b1b6b026dea14dd302a27901355a0f459
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / b26-0.0.1-py3-none-any.whl
| Download URL | b26-0.0.1-py3-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cee429584a05778836d15628c96254dfde39cf26833794ea9a88584d3e677319
|
|
BLAKE2b-256 checksum How to use checksums |
e4902b4fdaf231c3db9d6fb45a6d7a2331d2fcf8c4860dc12edad530e1c4ab70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|