1{
2 bleach,
3 buildPythonPackage,
4 certifi,
5 charset-normalizer,
6 fetchPypi,
7 hatchling,
8 idna,
9 lib,
10 python-dateutil,
11 python-slugify,
12 requests,
13 setuptools,
14 six,
15 text-unidecode,
16 tqdm,
17 urllib3,
18 webencodings,
19}:
20
21buildPythonPackage rec {
22 pname = "kaggle";
23 version = "1.6.17";
24 pyproject = true;
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-Q5p96h1QOfMg/WrV7CG2iNz6cNQFy0IJW4H0HtxAG4E=";
29 };
30
31 build-system = [ hatchling ];
32
33 dependencies = [
34 bleach
35 certifi
36 charset-normalizer
37 idna
38 python-dateutil
39 python-slugify
40 requests
41 setuptools
42 six
43 text-unidecode
44 tqdm
45 urllib3
46 webencodings
47 ];
48
49 # Tests try to access the network.
50 checkPhase = ''
51 export HOME="$TMP"
52 mkdir -p "$HOME/.kaggle/"
53 echo '{"username":"foobar","key":"00000000000000000000000000000000"}' > "$HOME/.kaggle/kaggle.json"
54 $out/bin/kaggle --help > /dev/null
55 '';
56 pythonImportsCheck = [ "kaggle" ];
57
58 meta = with lib; {
59 description = "Official API for https://www.kaggle.com, accessible using a command line tool implemented in Python 3";
60 mainProgram = "kaggle";
61 homepage = "https://github.com/Kaggle/kaggle-api";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ mbalatsko ];
64 };
65}