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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e2e9fecbb58c923bdb738aa3e41e445133db85fdc2cf2e00731dea42db84eee
|
|
| MD5 |
06f433309b811bc3bd54432e6272aab8
|
|
| BLAKE2b-256 |
f83317589be766725e5f8fe4ca52b16de93f4b97a66b6ef7dbe9c33e38104f7f
|
Provenance
The following attestation bundles were made for pypac_multiply-0.1.1.tar.gz:
Publisher:
python-publish.yml on adunavolgyi/pypac-multiply
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypac_multiply-0.1.1.tar.gz -
Subject digest:
6e2e9fecbb58c923bdb738aa3e41e445133db85fdc2cf2e00731dea42db84eee - Sigstore transparency entry: 2368883019
- Sigstore integration time:
-
Permalink:
adunavolgyi/pypac-multiply@65306a3e742e3dc9978349f644322067771efc14 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/adunavolgyi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@65306a3e742e3dc9978349f644322067771efc14 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e810421bbea37fc723c5da51a4b017f71178a2e03c510dd5b77831b1f478b8f
|
|
| MD5 |
7282b0ea32f4dd97b6fb51b57fe7e787
|
|
| BLAKE2b-256 |
af7b911c9dead8210b2f3219c126dad5a45e2a566c29d7e11e840cd610cf2e60
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypac_multiply-0.1.1-py3-none-any.whl -
Subject digest:
6e810421bbea37fc723c5da51a4b017f71178a2e03c510dd5b77831b1f478b8f - Sigstore transparency entry: 2368883428
- Sigstore integration time:
-
Permalink:
adunavolgyi/pypac-multiply@65306a3e742e3dc9978349f644322067771efc14 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/adunavolgyi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@65306a3e742e3dc9978349f644322067771efc14 -
Trigger Event:
workflow_dispatch
-
Statement type: