1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pycryptodome,
6 pythonOlder,
7 requests,
8 setuptools,
9 websocket-client,
10 # dependencies for tests
11 pytest-cov-stub,
12 sure,
13 responses,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "binance-connector";
19 version = "3.12.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "binance";
26 repo = "${pname}-python";
27 tag = "v${version}";
28 hash = "sha256-8O73+fli0HNbvGBcyg79ZGOTQvL0TF5SCfogI6btlrA=";
29 };
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 requests
35 pycryptodome
36 websocket-client
37 ];
38
39 nativeCheckInputs = [
40 pytest-cov-stub
41 sure
42 responses
43 pytestCheckHook
44 ];
45
46 # pytestCheckHook attempts to run examples directory, which requires
47 # network access
48 disabledTestPaths = [ "examples/" ];
49
50 pythonImportsCheck = [
51 "binance.spot"
52 "binance.websocket"
53 ];
54
55 meta = with lib; {
56 description = "Simple connector to Binance Public API";
57 homepage = "https://github.com/binance/binance-connector-python";
58 license = licenses.mit;
59 maintainers = with maintainers; [ trishtzy ];
60 };
61}