Skip to content

Commit

Permalink
Merge pull request #92147 from cdepillabout/add-kaggle
Browse files Browse the repository at this point in the history
kaggle: init at 1.5.6
  • Loading branch information
cdepillabout committed Jul 5, 2020
2 parents 149efc5 + e97b8b6 commit f233572
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
53 changes: 53 additions & 0 deletions pkgs/development/python-modules/kaggle/default.nix
@@ -0,0 +1,53 @@
{ buildPythonPackage
, certifi
, fetchPypi
, lib
, python-dateutil
, python-slugify
, six
, requests
, tqdm
, urllib3
}:

buildPythonPackage rec {
pname = "kaggle";
version = "1.5.6";

src = fetchPypi {
inherit pname version;
sha256 = "0f5qrkgklcpgbwncrif7aw4f86dychqplh7k3f4rljwnr9yhjb1w";
};

# The version bounds in the setup.py file are unnecessarily restrictive.
patchPhase = ''
substituteInPlace setup.py \
--replace 'urllib3 >= 1.21.1, < 1.25' 'urllib3'
'';

propagatedBuildInputs = [
certifi
python-dateutil
python-slugify
requests
six
tqdm
urllib3
];

# Tests try to access the network.
checkPhase = ''
export HOME="$TMP"
mkdir -p "$HOME/.kaggle/"
echo '{"username":"foobar","key":"00000000000000000000000000000000"}' > "$HOME/.kaggle/kaggle.json"
$out/bin/kaggle --help > /dev/null
'';
pythonImportsCheck = [ "kaggle" ];

meta = with lib; {
description = "Official API for https://www.kaggle.com, accessible using a command line tool implemented in Python 3";
homepage = "https://github.com/Kaggle/kaggle-api";
license = licenses.asl20;
maintainers = with maintainers; [ cdepillabout ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -2048,6 +2048,8 @@ in

ir-standard-fonts = callPackage ../data/fonts/ir-standard-fonts { };

kaggle = with python3Packages; toPythonApplication kaggle;

lynis = callPackage ../tools/security/lynis { };

mapproxy = callPackage ../applications/misc/mapproxy { };
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -4340,6 +4340,8 @@ in {

jupyterhub-ldapauthenticator = callPackage ../development/python-modules/jupyterhub-ldapauthenticator { };

kaggle = callPackage ../development/python-modules/kaggle { };

keyring = if isPy3k then
callPackage ../development/python-modules/keyring { }
else
Expand Down

0 comments on commit f233572

Please sign in to comment.