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.1.tar.gz (5.3 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.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pypac_multiply-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 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.1.tar.gz
Algorithm Hash digest
SHA256 6e2e9fecbb58c923bdb738aa3e41e445133db85fdc2cf2e00731dea42db84eee
MD5 06f433309b811bc3bd54432e6272aab8
BLAKE2b-256 f83317589be766725e5f8fe4ca52b16de93f4b97a66b6ef7dbe9c33e38104f7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypac_multiply-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pypac_multiply-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e810421bbea37fc723c5da51a4b017f71178a2e03c510dd5b77831b1f478b8f
MD5 7282b0ea32f4dd97b6fb51b57fe7e787
BLAKE2b-256 af7b911c9dead8210b2f3219c126dad5a45e2a566c29d7e11e840cd610cf2e60

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypac_multiply-0.1.1-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