Skip to main content

pypac-multiply

pypac-multiply is a small, dependency-free Python library that converts an integer into its basic IUPAC numerical multiplier prefix.

from pypac_multiply import multiplier

multiplier(1)  # "mono"
multiplier(21)  # "henicosa"
multiplier(32)  # "dotriaconta"
multiplier(241)  # "hentetracontadicta"

The package generates terms algorithmically for the complete range covered by the IUPAC rules, 1 through 9999. It has no runtime dependencies.

Installation

python -m pip install pypac-multiply

Usage

The public API consists of one function:

def multiplier(number: int) -> str: ...

number must be a built-in integer from 1 through 9999. Values outside that range raise ValueError; other types and integer subclasses, including bool, raise TypeError.

multiplier(0)  # ValueError
multiplier(4.2)  # TypeError
multiplier(True)  # TypeError

The implementation follows section P-14.2.1 of the 2013 IUPAC Nomenclature of Organic Chemistry (the Blue Book). Composite terms cite units before tens, hundreds, and thousands. It also implements the prescribed exceptional forms for 1, 2, and 11, and elides the initial i of icosa after a vowel.

One source inconsistency is resolved in favor of the construction rule: Blue Book Table 1.4 prints henkilla for 1001, while the same table defines 1000 as kilia and P-14.2.1.2 requires direct joining. This package therefore returns henkilia for 1001.

Development

Clone the repository and install the development dependencies using a tool that supports the standardized dependency-groups table, for example:

python -m pip install --group dev --editable .

Then run the checks:

pytest
ruff check .
ruff format --check .
mypy
python -m build
python -m twine check dist/*

References

License

MIT

Download files

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

Source Distribution

pypac_multiply-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

pypac_multiply-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pypac_multiply-0.1.0.tar.gz.

File metadata

  • Download URL: pypac_multiply-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pypac_multiply-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59ad59f513bdf0605af60fd2312dc8c7e9b0f3632524b581ead65363420c4a85
MD5 00857b7a316d331044c8be9ea9f3267f
BLAKE2b-256 084ccd629d489601cd56dbc6e1f6bbf7aa73c43fbfa15cfa17015384b61bada1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypac_multiply-0.1.0.tar.gz:

Publisher: python-publish.yml on adunavolgyi/pypac-multiply

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

File details

Details for the file pypac_multiply-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pypac_multiply-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pypac_multiply-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94128a344826b474fcc2682ebb0b685b547fe425ae6bd7be456fe5cd5efe50ae
MD5 e182a7a130b768d28c4b9faf702c6532
BLAKE2b-256 0dfa061501407015dd1464354221bfd00698479bf20a128db0a3054f1b33ab98

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypac_multiply-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on adunavolgyi/pypac-multiply

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