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
To get started, import num2label:
>>> import num2label
Integer to letter
Map an integer to an uppercase letter of the alphabet:
>>> num2label.uppercase_letter(1)
'A'
Or a lowercase letter:
>>> num2label.lowercase_letter(26)
'z'
Integer to spreadsheet column label
Map a number to a spreadsheet column label:
>>> num2label.spreadsheet_column(28)
'AB'
Number bounds
The number must always be greater than zero. The number can be greater than 26. uppercase_letter and lowercase_letter will effectively loop the alphabet until the corresponding letter is reached (e.g., 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.post1.tar.gz.
File metadata
- Download URL: num2label-1.0.0.post1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5248dfe08c84e1564a6a181e2cadc872b06a276db1195797eea1741c2b63e49a
|
|
| MD5 |
80edf5e733c67a4c862d244f32c74b8e
|
|
| BLAKE2b-256 |
d29bc9876cf375546ffb62598fc470e7baf8015a2cdc7edcd464e645feb033b7
|
Provenance
The following attestation bundles were made for num2label-1.0.0.post1.tar.gz:
Publisher:
python-publish.yml on ethanbradley/num2label
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
num2label-1.0.0.post1.tar.gz -
Subject digest:
5248dfe08c84e1564a6a181e2cadc872b06a276db1195797eea1741c2b63e49a - Sigstore transparency entry: 189384891
- Sigstore integration time:
-
Permalink:
ethanbradley/num2label@cdfe94f5475883486d4051c60d501cc308d3c5dd -
Branch / Tag:
refs/tags/v1.0.0.post1 - Owner: https://github.com/ethanbradley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cdfe94f5475883486d4051c60d501cc308d3c5dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file num2label-1.0.0.post1-py3-none-any.whl.
File metadata
- Download URL: num2label-1.0.0.post1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a146d07cedd25fd813d4c66fca49ebc6bebcce2b14557c972a54b93fd29bd4e
|
|
| MD5 |
83372ee30ed44e82e391143a416a055d
|
|
| BLAKE2b-256 |
ec92b61a58e7f06ebc4a4d3b986d63724c3800e13360aad454eab9a98eb7781f
|
Provenance
The following attestation bundles were made for num2label-1.0.0.post1-py3-none-any.whl:
Publisher:
python-publish.yml on ethanbradley/num2label
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
num2label-1.0.0.post1-py3-none-any.whl -
Subject digest:
8a146d07cedd25fd813d4c66fca49ebc6bebcce2b14557c972a54b93fd29bd4e - Sigstore transparency entry: 189384896
- Sigstore integration time:
-
Permalink:
ethanbradley/num2label@cdfe94f5475883486d4051c60d501cc308d3c5dd -
Branch / Tag:
refs/tags/v1.0.0.post1 - Owner: https://github.com/ethanbradley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cdfe94f5475883486d4051c60d501cc308d3c5dd -
Trigger Event:
push
-
Statement type: