Skip to main content

A1 notation converter

The A1 notation converter library allows the user to convert integer to its A1 notation form and vice versa. In this context, the A1 notation refer to the syntax used in spreadsheet program such as Google Sheets and Microsoft Excel to represent the index of column within the spreadhseet.
E.g. 'G' represents 7th column, 'AZ' represents 52th column.


Version 1.0.9

  • Fixed logic error in function 'int_to_a1()' where number value from 52 does not modulo and divide properly to output the correct A1 notation. E.g.
int_to_a1(52) # return "B@" (should be "AZ")
int_to_a1(78) # return "C@" (should be "BZ")
  • Added unit testing to validate function behaviour.

Installation

Installation of this library can be done with Python pip:
pip install a1-notation-converter
The package and release history can be found at pypi.org.


Example

Importing the library:

from a1_notation_converter import a1_converter

Converting integer to A1 notation:

a1_converter.int_to_a1(1)       # return "A"
a1_converter.int_to_a1(27)      # return "AA"
a1_converter.int_to_a1(731)     # return "ABC"

Converting A1 notation to integer:

a1_converter.a1_to_int("A")      # return 1
a1_converter.a1_to_int("AA")     # return 27
a1_converter.a1_to_int("CBA")    # return 2081

Documentation

int_to_a1( )
Syntax: int_to_a1(number : int, starting_index : int = 1) -> str

Arguments:

  • number: The integer that is going to be converted to A1 notation.
  • starting_index: Specify whether the A1 notation 'A' represents the 0th column or 1st column. Default to starting_index = 1.

Return:
A string represents the A1 notation of the given integer.

a1_to_int( )
Syntax: a1_to_int(a1_notation : str) -> int

Arguments:

  • a1_notation: The string that is going to be converted to integer representation.

Return:
An integer represents the number value of the given string.

Metadata

Release files for a1-notation-converter 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a1-notation-converter 1.0.9
File Size Uploaded Provenance
a1_notation_converter-1.0.9.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for a1-notation-converter 1.0.9
File Interpreter ABI Platform
a1_notation_converter-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 kB

Release files / a1_notation_converter-1.0.9.tar.gz

Download URL a1_notation_converter-1.0.9.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b89acb3aefb1ccbd8dfadb9c9c0be22349789868039bf2d1f03a554b783c0529
BLAKE2b-256 checksum
How to use checksums
8b5b68732319efb88796d0a09c416031bd9e16a64d5c55ed650f9e65f4415db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Release files / a1_notation_converter-1.0.9-py3-none-any.whl

Download URL a1_notation_converter-1.0.9-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42c37d398fc3f888c9f8dd7232b68b65fe263fb390fa6162dffa81c6f10a93f6
BLAKE2b-256 checksum
How to use checksums
2554772dc4ff7b544314d48f69fb7456b89576cadbab5e2818702789ea95c4f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Security for a1-notation-converter 1.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page