python-indic-numtowords

LOW
maintainer Smoolak 0 votes scanned 2026-11-01 18:01:05.785766
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: Smoolak <smoolak@gmail.com>
2pkgname=python-indic-numtowords
3pkgver=1.0.2
4pkgrel=1
5pkgdesc='Convert numbers to words in Indian languages and English'
6arch=(any)
7url='https://github.com/AI4Bharat/indic-numtowords'
8license=(MIT)
9depends=(python)
10makedepends=(python-build python-installer python-setuptools python-wheel)
11_commit=8ab6d4472ffd5be34b1bd6a2acfec9b669f51ef0
12source=("indic-numtowords-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
13sha256sums=('448f8b029a398e96f158ce829a22ec227bd677167352d3d470658d7be52b6c40')
14
15prepare() {
16 cd "indic-numtowords-$_commit"
17 # The documented integer split=True path incorrectly iterates an integer.
18 python - <<'PYPREP'
19from pathlib import Path
20path = Path("indic_numtowords/numtowords.py")
21text = path.read_text()
22for old, new in [
23 ("for digit in number)", "for digit in str(number))"),
24 ("for digit in (number if split else number_str)",
25 "for digit in (str(number) if split else number_str)"),
26]:
27 assert text.count(old) == 1
28 text = text.replace(old, new)
29path.write_text(text)
30PYPREP
31}
32
33build() {
34 cd "indic-numtowords-$_commit"
35 python -m build --wheel --no-isolation
36}
37
38check() {
39 cd "indic-numtowords-$_commit"
40 # Upstream ships no automated suite. Verify its three README examples.
41 python -m installer --destdir="$srcdir/check" dist/*.whl
42 local site_packages=("$srcdir"/check/usr/lib/python*/site-packages)
43 cd "$srcdir"
44 PYTHONPATH="${site_packages[0]}" python - <<'PYTEST'
45from indic_numtowords import num2words
46assert num2words(38, lang='ta') == 'முப்பத்து எட்டு'
47assert num2words(150, lang='hi', variations=True) == ['एक सौ पचास', 'डेढ़ सौ']
48assert num2words(420, lang='doi', split=True) == 'चार दो सिफर'
49for language in ['hi', 'doi']:
50 assert num2words(420, lang=language, split=True) == num2words('420', lang=language, split=True)
51 assert num2words(1234567890, lang=language) == num2words('1234567890', lang=language)
52print('Upstream README examples and integer digit conversion: PASS')
53PYTEST
54}
55
56package() {
57 cd "indic-numtowords-$_commit"
58 python -m installer --destdir="$pkgdir" dist/*.whl
59 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
60}
61

Scan history

Scanned at (UTC)SeverityRules
2026-11-01 18:01:05 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion