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