Metadata-Version: 2.4
Name: ocrgrep
Version: 0.1.0
Summary: grep-like OCR tool for images and videos.
Author-email: tmctmt <tmctmt@proton.me>
License: MIT License
        
        Copyright (c) 2026 tmctmt
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: ocr,grep,screen ai,chrome,locro
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tqdm~=4.0
Requires-Dist: opencv-python~=4.0
Requires-Dist: filetype~=1.0
Requires-Dist: Pillow~=12.0
Dynamic: license-file

## ocrgrep
A grep-like OCR tool for image and video files, utilizing the fast and accurate [Google Screen AI](https://chromium.googlesource.com/chromium/src/+/refs/tags/126.0.6452.4/services/screen_ai/README.md) engine via [locro](https://github.com/sergiocorreia/clv-locro/tree/master).

```
$ ocrgrep -ih 'grep-like' screenshot.png    
rep README.md in main Preview ocrgrep A grep-like OCR tool for image and video files, uti
```

```
usage: ocrgrep.py [-i] [-m NUM] [-p] [-r] [-w NUM] [-C NUM] [-F] [-h] [-t] [--include GLOB]
                  [--exclude GLOB] [--no-image] [--no-video] [--video-max-msec NUM]
                  [--video-step-msec NUM] [--help]
                  pattern files [files ...]

positional arguments:
  pattern
  files

options:
  -i, --ignore-case     ignore case distinctions in patterns and data
  -m, --max-count NUM   stop after NUM selected lines
  -p, --progress        show progress bar
  -r, --recursive       scan subfiles in directories
  -w, --workers NUM     concurrency (default: 16)
  -C, --context NUM     print NUM characters of output context (default: 40)
  -F, --fixed-strings   PATTERN is a string
  -h, --no-filename     suppress the file name prefix on output
  -t, --no-timestamp    suppress the timestamp prefix on output for videos
  --include GLOB        search only files that match GLOB (a file pattern)
  --exclude GLOB        skip files that match GLOB
  --no-image            ignore image files
  --no-video            ignore video files
  --video-max-msec NUM  stop after NUM milliseconds of video
  --video-step-msec NUM
                        scan a frame for every NUM milliseconds of video (default: 1000)
  --help                show this help message and exit
```
  
# Install
```
pip install git+https://github.com/sergiocorreia/clv-locro.git
locro download
pip install ocrgrep
```
