summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pdfplumber/default.nix
blob: 483015cd40217d7d4859488d4ec197a82f023178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  pkgs,
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  jupyterlab,
  nbexec,
  pandas,
  pandas-stubs,
  pdfminer-six,
  pillow,
  pypdfium2,
  pytest-cov-stub,
  pytest-parallel,
  pytestCheckHook,
  types-pillow,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "pdfplumber";
  version = "0.11.9";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jsvine";
    repo = "pdfplumber";
    tag = "v${version}";
    hash = "sha256-vOtr+9qRpd+VXUpVL2whflbA7Gchd4yuA47FBl5BYfE=";
  };

  build-system = [ setuptools ];

  dependencies = [
    pdfminer-six
    pillow
    pypdfium2
  ];

  nativeCheckInputs = [
    pkgs.ghostscript
    jupyterlab
    nbexec
    pandas
    pandas-stubs
    pytest-cov-stub
    pytest-parallel
    pytestCheckHook
    types-pillow
    writableTmpDirAsHomeHook
  ];

  pythonRelaxDeps = [ "pdfminer.six" ];

  disabledTestPaths = [
    # AssertionError
    "tests/test_convert.py::Test::test_cli_csv"
    "tests/test_convert.py::Test::test_cli_csv_exclude"
    "tests/test_convert.py::Test::test_csv"
  ];

  pythonImportsCheck = [ "pdfplumber" ];

  meta = {
    description = "Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables";
    mainProgram = "pdfplumber";
    homepage = "https://github.com/jsvine/pdfplumber";
    changelog = "https://github.com/jsvine/pdfplumber/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ happysalada ];
  };
}