2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-08-22 20:05:09 +00:00
|
|
|
, jupyterlab
|
|
|
|
, nbexec
|
|
|
|
, pandas
|
|
|
|
, pandas-stubs
|
2023-07-15 17:15:38 +00:00
|
|
|
, pdfminer-six
|
|
|
|
, pillow
|
|
|
|
, pytest-parallel
|
2023-08-22 20:05:09 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
, types-pillow
|
2023-08-22 20:05:09 +00:00
|
|
|
, wand
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "pdfplumber";
|
|
|
|
version = "0.9.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jsvine";
|
|
|
|
repo = "pdfplumber";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-cGTn1JTSp1YvksemjlvvToZcVauZ7GKINiNmG5f4zKg=";
|
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov=pdfplumber --cov-report xml:coverage.xml --cov-report term" ""
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pdfminer-six
|
|
|
|
pillow
|
|
|
|
wand
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
jupyterlab
|
|
|
|
nbexec
|
2023-07-15 17:15:38 +00:00
|
|
|
pandas
|
|
|
|
pandas-stubs
|
2023-08-22 20:05:09 +00:00
|
|
|
pytest-parallel
|
|
|
|
pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
types-pillow
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pdfplumber"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# flaky
|
|
|
|
"test__repr_png_"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-08-22 20:05:09 +00:00
|
|
|
description = "Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/jsvine/pdfplumber";
|
|
|
|
changelog = "https://github.com/jsvine/pdfplumber/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|