1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools-scm,
6 future,
7 python,
8 pythonOlder,
9}:
10
11buildPythonPackage rec {
12 pname = "word2number";
13 version = "1.1";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "akshaynagpal";
18 repo = "w2n";
19 tag = version;
20 hash = "sha256-dgHPEfieNDZnP6+YvywvN3ZzmeICav0WMYKkWDSJ/LE=";
21 };
22
23 build-system = [
24 setuptools-scm
25 ];
26
27 dependencies = lib.optionals (pythonOlder "3.13") [
28 future
29 ];
30
31 pythonImportsCheck = [
32 "word2number"
33 ];
34
35 checkPhase = ''
36 ${lib.getExe python} unit_testing.py
37 '';
38
39 meta = {
40 changelog = "https://github.com/akshaynagpal/w2n/releases/tag/${version}";
41 description = "Convert number words (eg. twenty one) to numeric digits (21)";
42 homepage = "http://w2n.readthedocs.io/";
43 license = [ lib.licenses.mit ];
44 maintainers = [ lib.maintainers.booxter ];
45 };
46}