1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 orjson,
6 pandas,
7 poetry-core,
8 polars,
9 pytest-mock,
10 pytestCheckHook,
11 python-dateutil,
12 pythonOlder,
13 requests,
14 tqdm,
15 typer,
16 websocket-client,
17}:
18
19buildPythonPackage rec {
20 pname = "coinmetrics-api-client";
21 version = "2025.5.6.13";
22 pyproject = true;
23
24 disabled = pythonOlder "3.9";
25
26 __darwinAllowLocalNetworking = true;
27
28 src = fetchPypi {
29 inherit version;
30 pname = "coinmetrics_api_client";
31 hash = "sha256-EUxgT+LK0s7IV+EWrLKgkNMsuhZBOUfMN1PLjub9JWQ=";
32 };
33
34 pythonRelaxDeps = [ "typer" ];
35
36 build-system = [ poetry-core ];
37
38 dependencies = [
39 orjson
40 python-dateutil
41 requests
42 typer
43 tqdm
44 websocket-client
45 ];
46
47 optional-dependencies = {
48 pandas = [ pandas ];
49 polars = [ polars ];
50 };
51
52 nativeCheckInputs = [
53 pytestCheckHook
54 pytest-mock
55 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
56
57 pythonImportsCheck = [ "coinmetrics.api_client" ];
58
59 meta = with lib; {
60 description = "Coin Metrics API v4 client library";
61 homepage = "https://coinmetrics.github.io/api-client-python/site/index.html";
62 license = licenses.mit;
63 maintainers = with maintainers; [ centromere ];
64 mainProgram = "coinmetrics";
65 };
66}