depot/third_party/nixpkgs/pkgs/tools/text/invoice2data/default.nix
Default email 5557ff764c Project import generated by Copybara.
GitOrigin-RevId: 988cc958c57ce4350ec248d2d53087777f9e1949
2023-02-22 11:55:15 +01:00

59 lines
1.1 KiB
Nix

{ lib
, fetchFromGitHub
, ghostscript
, imagemagick
, poppler_utils
, python3
, tesseract5
}:
python3.pkgs.buildPythonApplication rec {
pname = "invoice2data";
version = "0.4.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "invoice-x";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ss2h8cg0sga+lzJyQHckrZB/Eb63Oj3FkqmGqWCzCQ8=";
};
buildInputs = with python3.pkgs; [ setuptools-git ];
propagatedBuildInputs = with python3.pkgs; [
chardet
dateparser
pdfminer-six
pillow
pyyaml
setuptools
unidecode
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "pytest-runner" ""
'';
makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
ghostscript
imagemagick
tesseract5
poppler_utils
])];
# Tests fails even when ran manually on my ubuntu machine !!
doCheck = false;
pythonImportsCheck = [
"invoice2data"
];
meta = with lib; {
description = "Data extractor for PDF invoices";
homepage = "https://github.com/invoice-x/invoice2data";
license = licenses.mit;
maintainers = with maintainers; [ psyanticy ];
};
}