1{
2 lib,
3 aiohttp,
4 aioresponses,
5 buildPythonPackage,
6 dateparser,
7 fetchFromGitHub,
8 pycryptodome,
9 pytest-asyncio,
10 pytestCheckHook,
11 pythonOlder,
12 requests-mock,
13 requests,
14 six,
15 ujson,
16 setuptools,
17 websockets,
18}:
19
20buildPythonPackage rec {
21 pname = "python-binance";
22 version = "1.0.29";
23 pyproject = true;
24
25 disabled = pythonOlder "3.11";
26
27 src = fetchFromGitHub {
28 owner = "sammchardy";
29 repo = "python-binance";
30 tag = "v${version}";
31 hash = "sha256-Hqd6228k2j1BPzBBCRpdEp0rAGxZt00XPnzpCPlwIfg=";
32 };
33
34 build-system = [ setuptools ];
35
36 dependencies = [
37 aiohttp
38 dateparser
39 requests
40 pycryptodome
41 six
42 ujson
43 websockets
44 ];
45
46 nativeCheckInputs = [
47 aioresponses
48 pytest-asyncio
49 pytestCheckHook
50 requests-mock
51 ];
52
53 disabledTestPaths = [
54 # Tests require network access
55 "tests/test_api_request.py"
56 "tests/test_async_client.py"
57 "tests/test_async_client_futures.py"
58 "tests/test_async_client_margin.py"
59 "tests/test_async_client_options.py"
60 "tests/test_async_client_portfolio.py"
61 "tests/test_async_client_ws_api.py"
62 "tests/test_async_client_ws_futures_requests.py"
63 "tests/test_client.py"
64 "tests/test_client_futures.py"
65 "tests/test_client_gift_card.py"
66 "tests/test_client_margin.py"
67 "tests/test_client_options.py"
68 "tests/test_client_portfolio.py"
69 "tests/test_client_ws_api.py"
70 "tests/test_client_ws_futures_requests.py"
71 "tests/test_depth_cache.py"
72 "tests/test_get_order_book.py"
73 "tests/test_ping.py"
74 "tests/test_reconnecting_websocket.py"
75 "tests/test_socket_manager.py"
76 "tests/test_streams.py"
77 "tests/test_threaded_socket_manager.py"
78 "tests/test_threaded_stream.py"
79 "tests/test_ws_api.py"
80 ];
81
82 pythonImportsCheck = [ "binance" ];
83
84 meta = with lib; {
85 description = "Binance Exchange API python implementation for automated trading";
86 homepage = "https://github.com/sammchardy/python-binance";
87 license = licenses.mit;
88 maintainers = with maintainers; [ bhipple ];
89 };
90}