1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 setuptools-scm,
7 altair,
8 fastapi,
9 geopandas,
10 kaleido,
11 llmx,
12 matplotlib,
13 matplotlib-venn,
14 networkx,
15 numpy,
16 pandas,
17 plotly,
18 plotnine,
19 pydantic,
20 python-multipart,
21 scipy,
22 seaborn,
23 statsmodels,
24 typer,
25 uvicorn,
26 wordcloud,
27 peacasso,
28 basemap,
29 basemap-data-hires,
30 geopy,
31}:
32
33buildPythonPackage rec {
34 pname = "lida";
35 version = "0.0.14";
36 pyproject = true;
37
38 # No releases or tags are available in https://github.com/microsoft/lida
39 src = fetchPypi {
40 inherit pname version;
41 hash = "sha256-/az6hS8rNPxb8cDiz9SOyUBi/X48r9prJNFUnx1wPHM=";
42 };
43
44 patches = [
45 # The upstream places the data path under the py file's own directory.
46 # However, since `/nix/store` is read-only, we patch it to the user's home directory.
47 ./rw_data.patch
48 ];
49
50 build-system = [
51 setuptools
52 setuptools-scm
53 ];
54
55 dependencies = [
56 altair
57 fastapi
58 geopandas
59 kaleido
60 llmx
61 matplotlib
62 matplotlib-venn
63 networkx
64 numpy
65 pandas
66 plotly
67 plotnine
68 pydantic
69 python-multipart
70 scipy
71 seaborn
72 statsmodels
73 typer
74 uvicorn
75 wordcloud
76 ];
77
78 optional-dependencies = {
79 infographics = [
80 peacasso
81 ];
82 tools = [
83 basemap
84 basemap-data-hires
85 geopy
86 ];
87 transformers = [
88 llmx
89 ];
90 web = [
91 fastapi
92 uvicorn
93 ];
94 };
95
96 # require network
97 doCheck = false;
98
99 pythonImportsCheck = [ "lida" ];
100
101 meta = {
102 description = "Automatic Generation of Visualizations and Infographics using Large Language Models";
103 homepage = "https://github.com/microsoft/lida";
104 license = lib.licenses.mit;
105 maintainers = with lib.maintainers; [ moraxyc ];
106 mainProgram = "lida";
107 };
108}