1{
2 lib, fetchFromGitHub, buildPythonPackage, isPy3k,
3 # runtime dependencies
4 pandas, numpy, requests, inflection, python-dateutil, six, more-itertools,
5 # test suite dependencies
6 nose, unittest2, flake8, httpretty, mock, factory_boy, jsondate,
7 # additional runtime dependencies are required on Python 2.x
8 pyOpenSSL ? null, ndg-httpsclient ? null, pyasn1 ? null
9}:
10
11buildPythonPackage rec {
12 pname = "quandl";
13 version = "3.2.1";
14 sha256 = "0vc0pzs2px9yaqkqcmd2m1b2bq1iils8fs0xbl0989hjq791a4jr";
15
16 patches = [ ./allow-requests-v2.18.patch ];
17
18 # Tests do not work with fetchPypi
19 src = fetchFromGitHub {
20 owner = pname;
21 repo = "quandl-python";
22 rev = "refs/tags/v${version}";
23 inherit sha256;
24 fetchSubmodules = true; # Fetching by tag does not work otherwise
25 };
26
27 doCheck = true;
28
29 checkInputs = [
30 nose
31 unittest2
32 flake8
33 httpretty
34 mock
35 factory_boy
36 jsondate
37 ];
38
39 propagatedBuildInputs = [
40 pandas
41 numpy
42 requests
43 inflection
44 python-dateutil
45 six
46 more-itertools
47 ] ++ lib.optional (!isPy3k) [
48 pyOpenSSL
49 ndg-httpsclient
50 pyasn1
51 ];
52
53 meta = {
54 homepage = "https://github.com/quandl/quandl-python";
55 description = "Quandl Python client library";
56 maintainers = [ lib.maintainers.ilya-kolpakov ];
57 license = lib.licenses.mit;
58 };
59}