1{
2 buildPythonPackage,
3 fetchPypi,
4 lib,
5 # build dependencies
6 cython,
7 leptonica,
8 pkg-config,
9 tesseract,
10 # extra python packages
11 pillow
12}:
13
14buildPythonPackage rec {
15 pname = "tesserocr";
16 version = "2.5.2";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "1bmj76gi8401lcqdaaznfmz9yf11myy1bzivqwwq08z3dwzxswck";
21 };
22
23 nativeBuildInputs = [ cython pkg-config ];
24 buildInputs = [ leptonica tesseract ];
25 propagatedBuildInputs = [ pillow ];
26
27 meta = with lib; {
28 description = "A simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR)";
29 homepage = "https://github.com/sirfz/tesserocr";
30 license = licenses.mit;
31 maintainers = with maintainers; [ mtrsk ];
32 platforms = platforms.linux;
33 };
34}