A package to map numbers to text labels.
Project description
num2label
A package to map numbers to text labels. For example, n maps to the nth letter of the alphabet. You can also map numbers to their corresponding spreadsheet column labels.
Quick start
Map an integer to a lowercase letter of the alphabet:
>>> import num2label
>>>
>>> num2label.lowercase_letter(1)
'a'
Or an uppercase letter:
>>> num2label.uppercase_letter(26)
'Z'
Or even map a number to a spreadsheet column label:
>>> num2label.spreadsheet_column(28)
'AB'
The number must always be greater than zero. The number can be greater than 26. lowercase_letter and uppercase_letter will effectively loop the alphabet until the corresponding letter is reached (i.e. 27 => 'a', 55 => 'C'). To ensure the number passed is strictly less than 27, pass strict=True. num2label.lowercase_letter(27, strict=True) will raise an error because the number is not between one and 26 (inclusive).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file num2label-1.0.0.tar.gz.
File metadata
- Download URL: num2label-1.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a99c09cad2ac4cadc33b65417df1af1992f1635343f1e363e52d9d4dcc5aeaf
|
|
| MD5 |
52f00dadd78897066869a65c8b94fb65
|
|
| BLAKE2b-256 |
a68775c947a581895fc2b828de9462ce94d895b8135c168355a317d42f36a29d
|
File details
Details for the file num2label-1.0.0-py3-none-any.whl.
File metadata
- Download URL: num2label-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2a7e92e0b77a3ceca18ce5bab5ff3d6e1b4a66f018a9dd0a82167498f19498e
|
|
| MD5 |
a878d486f519a50c73440bc8ccb72f1d
|
|
| BLAKE2b-256 |
a02e9c1eec3d72ead7a20bf48d9ee2637e5feb41647ef9014d4e04908310ebca
|