1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 levenshtein,
7 pytesseract,
8 opencv-python,
9 fuzzywuzzy,
10}:
11
12buildPythonPackage rec {
13 pname = "videocr";
14 version = "0.1.6";
15 pyproject = true;
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-w0hPfUK4un5JAjAP7vwOAuKlsZ+zv6sFV2vD/Rl3kbI=";
20 };
21
22 build-system = [ setuptools ];
23
24 dependencies = [
25 levenshtein
26 pytesseract
27 opencv-python
28 fuzzywuzzy
29 ];
30
31 postPatch = ''
32 substituteInPlace setup.py \
33 --replace-fail "python-Levenshtein" "Levenshtein"
34 substituteInPlace videocr/constants.py \
35 --replace-fail "master" "main"
36 substituteInPlace videocr/video.py \
37 --replace-fail '--tessdata-dir "{}"' '--tessdata-dir="{}"'
38 '';
39
40 # Project has no tests
41 doCheck = false;
42
43 pythonImportsCheck = [ "videocr" ];
44
45 meta = with lib; {
46 description = "Extract hardcoded subtitles from videos using machine learning";
47 homepage = "https://github.com/apm1467/videocr";
48 license = licenses.mit;
49 maintainers = with maintainers; [ ozkutuk ];
50 };
51}