Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 buildPythonPackage,
3 chardet,
4 charset-normalizer,
5 click,
6 fetchPypi,
7 lib,
8 opencv-python-headless,
9 openpyxl,
10 pandas,
11 pdfminer-six,
12 pillow,
13 pkgs,
14 pypdf,
15 pypdfium2,
16 setuptools,
17 tabulate,
18}:
19
20buildPythonPackage rec {
21 pname = "camelot-py";
22 version = "1.0.9";
23 pyproject = true;
24
25 src = fetchPypi {
26 pname = "camelot_py";
27 inherit version;
28 hash = "sha256-1D2Idm98NGKAP/EUZOfT0VqSI+hFly3ith73w/YtMgA=";
29 };
30
31 patches = [ ./ghostscript.patch ];
32
33 postPatch = ''
34 substituteInPlace camelot/backends/ghostscript_backend.py \
35 --replace-fail '@ghostscript@' ${lib.getExe pkgs.ghostscript_headless}
36 '';
37
38 pythonRelaxDeps = [ "pypdf" ];
39
40 build-system = [ setuptools ];
41
42 dependencies = [
43 chardet
44 charset-normalizer
45 click
46 opencv-python-headless
47 openpyxl
48 pandas
49 pdfminer-six
50 pillow
51 pypdf
52 pypdfium2
53 tabulate
54 ];
55
56 doCheck = false;
57
58 pythonImportsCheck = [ "camelot" ];
59
60 meta = {
61 description = "Python library to extract tabular data from PDFs";
62 mainProgram = "camelot";
63 homepage = "http://camelot-py.readthedocs.io";
64 changelog = "https://github.com/camelot-dev/camelot/blob/v${version}/HISTORY.md";
65 license = lib.licenses.mit;
66 maintainers = with lib.maintainers; [ _2gn ];
67 };
68}