1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 stdenv,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 astropy,
12 click,
13 frictionless,
14 matplotlib,
15 mergedeep,
16 pandas,
17 pillow,
18 pybtex,
19 pymupdf,
20 pyyaml,
21 scipy,
22 svg-path,
23 svgpathtools,
24 svgwrite,
25
26 # tests
27 pytestCheckHook,
28}:
29
30buildPythonPackage rec {
31 pname = "svgdigitizer";
32 version = "0.13.0";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "echemdb";
37 repo = "svgdigitizer";
38 tag = version;
39 hash = "sha256-UlcvCfNoEijIKoqSbufEZ6988rqwT2xDEy4P/9fdgVM=";
40 };
41
42 build-system = [
43 setuptools
44 ];
45
46 dependencies = [
47 astropy
48 click
49 frictionless
50 matplotlib
51 mergedeep
52 pandas
53 pillow
54 pybtex
55 pymupdf
56 pyyaml
57 scipy
58 svg-path
59 svgpathtools
60 svgwrite
61 ];
62 # https://github.com/echemdb/svgdigitizer/issues/252
63 MPLBACKEND = "Agg";
64
65 nativeCheckInputs = [
66 pytestCheckHook
67 ];
68 pytestFlags = [
69 "--doctest-modules"
70 "svgdigitizer"
71 ];
72
73 pythonImportsCheck = [
74 "svgdigitizer"
75 ];
76
77 meta = {
78 description = "Extract numerical data points from SVG files";
79 homepage = "https://github.com/echemdb/svgdigitizer";
80 changelog = "https://github.com/echemdb/svgdigitizer/blob/${src.tag}/ChangeLog";
81 license = lib.licenses.gpl3Only;
82 maintainers = with lib.maintainers; [ doronbehar ];
83 };
84}