python-indic-numtowords
LOW
maintainer Smoolak
0 votes
scanned 2026-11-01 18:01:05.785766
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>
2
pkgname=python-indic-numtowords
3
pkgver=1.0.2
4
pkgrel=1
5
pkgdesc='Convert numbers to words in Indian languages and English'
6
arch=(any)
7
url='https://github.com/AI4Bharat/indic-numtowords'
8
license=(MIT)
9
depends=(python)
10
makedepends=(python-build python-installer python-setuptools python-wheel)
11
_commit=8ab6d4472ffd5be34b1bd6a2acfec9b669f51ef0
12
source=("indic-numtowords-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
13
sha256sums=('448f8b029a398e96f158ce829a22ec227bd677167352d3d470658d7be52b6c40')
14
15
prepare() {
16
cd "indic-numtowords-$_commit"
17
# The documented integer split=True path incorrectly iterates an integer.
18
python - <<'PYPREP'
19
from pathlib import Path
20
path = Path("indic_numtowords/numtowords.py")
21
text = path.read_text()
22
for 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)
29
path.write_text(text)
30
PYPREP
31
}
32
33
build() {
34
cd "indic-numtowords-$_commit"
35
python -m build --wheel --no-isolation
36
}
37
38
check() {
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'
45
from indic_numtowords import num2words
46
assert num2words(38, lang='ta') == 'முப்பத்து எட்டு'
47
assert num2words(150, lang='hi', variations=True) == ['एक सौ पचास', 'डेढ़ सौ']
48
assert num2words(420, lang='doi', split=True) == 'चार दो सिफर'
49
for 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)
52
print('Upstream README examples and integer digit conversion: PASS')
53
PYTEST
54
}
55
56
package() {
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) | Severity | Rules |
|---|---|---|
| 2026-11-01 18:01:05 | Low | 1 |