nixpkgs/pkgs/tools/text/invoice2data/default.nix

59 lines
1.1 KiB
Nix
Raw Normal View History

2021-11-21 12:52:07 +00:00
{ lib
, fetchFromGitHub
, imagemagick
, python3
, tesseract
, xpdf
}:
2018-05-30 12:58:34 +00:00
2021-11-21 12:52:07 +00:00
python3.pkgs.buildPythonApplication rec {
2018-05-30 12:58:34 +00:00
pname = "invoice2data";
2021-11-21 12:52:07 +00:00
version = "0.3.6";
format = "setuptools";
2018-05-30 12:58:34 +00:00
2021-11-21 12:52:07 +00:00
src = fetchFromGitHub {
owner = "invoice-x";
repo = pname;
rev = "v${version}";
sha256 = "sha256-t1jgLyKtQsLINlnkCdSbVfTM6B/EiD1yGtx9UHjyZVE=";
2018-05-30 12:58:34 +00:00
};
2021-11-21 12:52:07 +00:00
nativeBuildInputs = with python3.pkgs; [
setuptools-git
];
2018-05-30 12:58:34 +00:00
2021-11-21 12:52:07 +00:00
propagatedBuildInputs = with python3.pkgs; [
chardet
dateparser
pdfminer
pillow
pyyaml
unidecode
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "pytest-runner" ""
'';
makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
imagemagick
tesseract
xpdf
])];
2018-05-30 12:58:34 +00:00
# Tests fails even when ran manually on my ubuntu machine !!
doCheck = false;
2021-11-21 12:52:07 +00:00
pythonImportsCheck = [
"invoice2data"
];
meta = with lib; {
2018-05-30 12:58:34 +00:00
description = "Data extractor for PDF invoices";
homepage = "https://github.com/invoice-x/invoice2data";
2018-05-30 12:58:34 +00:00
license = licenses.mit;
maintainers = with maintainers; [ psyanticy ];
};
}