Skip to main content

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 (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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

num2label-1.0.0.post0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

num2label-1.0.0.post0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file num2label-1.0.0.post0.tar.gz.

File metadata

  • Download URL: num2label-1.0.0.post0.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

Hashes for num2label-1.0.0.post0.tar.gz
Algorithm Hash digest
SHA256 167e39cb63212b60434aefafb8a0044ce42f90c43caa88e47d7c0211c8c8dbce
MD5 f25e26b58613309ca3229a38b18038c1
BLAKE2b-256 ac562883b9f129a37c6505771b793936812e407c64dd8e505cd8e316ab228b14

See more details on using hashes here.

Provenance

The following attestation bundles were made for num2label-1.0.0.post0.tar.gz:

Publisher: python-publish.yml on ethanbradley/num2label

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file num2label-1.0.0.post0-py3-none-any.whl.

File metadata

File hashes

Hashes for num2label-1.0.0.post0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bdeb811bed6857507151b1241e268a42873105b78e3ea05f000737b1361a555
MD5 1040c89884264b6dfcec1793149b981f
BLAKE2b-256 3e26b28751384d7585c52caf1d2f11f63f46c51ca9fd888ac42c4c58d60f84e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for num2label-1.0.0.post0-py3-none-any.whl:

Publisher: python-publish.yml on ethanbradley/num2label

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page