1{ lib
2, buildPythonPackage
3, poetry-core
4, regex
5, langcodes
6, ftfy
7, msgpack
8, mecab-python3
9, jieba
10, pytestCheckHook
11, pythonOlder
12, fetchFromGitHub
13}:
14
15buildPythonPackage rec {
16 pname = "wordfreq";
17 version = "3.0.2";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "rspeer";
24 repo = "wordfreq";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-ANOBbQWLB35Vz6oil6QZDpsNpKHeKUJnDKA5Q9JRVdE=";
27 };
28
29 nativeBuildInputs = [
30 poetry-core
31 ];
32
33 propagatedBuildInputs = [
34 regex
35 langcodes
36 ftfy
37 msgpack
38 mecab-python3
39 jieba
40 ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43 disabledTests = [
44 # These languages require additional dictionaries that aren't packaged
45 "test_languages"
46 "test_japanese"
47 "test_korean"
48 ];
49
50 meta = with lib; {
51 description = "A library for looking up the frequencies of words in many languages, based on many sources of data";
52 homepage = "https://github.com/rspeer/wordfreq/";
53 license = licenses.mit;
54 maintainers = with maintainers; [ ixxie ];
55 };
56}