Skip to main content

OCR-powered screen-capture tool to capture information instead of images.

Project description

NormCap

OCR powered screen-capture tool to capture information instead of images.

Build passing License: GPLv3 Code style: black Coverage Status

Links: Repo | PyPi | Releases | Changelog | FAQs

Content: Quickstart | Python package | Usage | Contribute | Credits

Screencast

Quickstart

❱❱ Download & run a pre-build package for Linux, MacOS or Windows ❰❰

Hints:

  • If you experience issues please look at the FAQs or open an issue.
  • On Linux, make the AppImage executable (e.g. chmod +x) before running it.
  • On MacOS, you have to allow the unsigned application on first start: "System Preferences" → "Security & Privacy" → Tab "General" → "Open anyway".
    Depending on your system, you might also need to allow NormCap to take screenshots.

Python package

As an alternative to a pre-build package you can install the NormCap Python package:

On Linux

# Install dependencies (Ubuntu/Debian)
sudo apt install tesseract-ocr tesseract-ocr-eng \
                 libtesseract-dev libleptonica-dev \
                 python3-dev

## Install dependencies (Arch)
sudo pacman -S tesseract tesseract-data-eng leptonica

## Install dependencies (Fedora)
sudo dnf install tesseract tesseract-devel \
                 libleptonica-devel python3-devel

# Install normcap
pip install normcap

# Run
./normcap

On MacOS

# Install dependencies
brew install tesseract tesseract-lang

# Install normcap
pip install normcap

# Run
./normcap

On Windows

1. Install "Tesseract 4.1", e.g. by using the installer provided by UB Mannheim.

2. Set the environment variable TESSDATA_PREFIX to Tesseract's data folder, e.g.:

setx TESSDATA_PREFIX "C:\Program Files\Tesseract-OCR\tessdata"

3. Install tesserocr using the Windows specific wheel and NormCap afterwards:

# Install tesserocr package
pip install https://github.com/simonflueckiger/tesserocr-windows_build/releases/download/tesserocr-v2.4.0-tesseract-4.0.0/tesserocr-2.4.0-cp37-cp37m-win_amd64.whl

# Install normcap
pip install normcap

# Run
normcap

Usage

General

  • Press <esc> key to abort a capture and quit the application.

  • Press <space> key while selecting a region with the mouse (left mouse button has to be hold down) to switch between the two capture modes:

    • ★ (parse): Try to auto-detect the type of text using magics and format the text accordingly, then copy
    • ☰ (raw): Copy detected text line by line, without further modification

Command line options

NormCap has some settings. If you use the settings menu in the UI, your settings are persisted in <users config folder>/normcap/config.yaml. If you start NormCap with a command line argument (other then -h, -v and -V), all persisted settings are ignored and only the settings provided as arguments are used:

(normcap)dynobo@cioran:~$ normcap --help
usage: normcap [-h] [-m MODE] [-l LANGUAGES] [-c COLOR] [-n] [-t] [-u] [-v] [-V]

OCR-powered screen-capture tool to capture information instead of images.

optional arguments:
  -h, --help                  show this help message and exit
  -m MODE, --mode MODE        set capture mode to 'raw' or 'parse'
                              (default: parse)
  -l LANGUAGES, --languages LANGUAGES
                              set language(s) for text recognition, e.g. eng+deu
                              (default: eng)
  -c COLOR, --color COLOR     set primary color for UI (default: #FF2E88)
  -n, --no-notifications      disable notifications shown after ocr detection
                              (default: False)
  -t, --tray                  keep running in system tray - experimental
                              (default: False)
  -u, --updates               search for updates on startup - experimental
                              (default: False)
  -v, --verbose               print debug information to console
                              (default: False)
  -V, --very-verbose          print more debug information to console
                              (default: False)

Magics

"Magics" are like add-ons providing automated functionality to intelligently detect and format the captured input.

First, every "magic" calculates a "score" to determine the likelihood of being responsible for this type of text. Second, the "magic" which achieved the highest "score" takes the necessary actions to "transform" the input text according to its type.

Currently implemented Magics:

Magic Score Transform
Single line Only single line is detected Trim unnecessary whitespace
Multi line Multi lines, but single Paragraph Separated by line breaks and trim each lined
Paragraph Multiple blocks of lines or multiple paragraphs Join every paragraph into a single line, separate different paragraphs by empty line
E-Mail Number of chars in email addresses vs. overall chars Transform to a comma-separated list of email addresses
URL Number of chars in URLs vs. overall chars Transform to line-break separated URLs

Why "NormCap"?

See XKCD:

Comic

Contribute

Setup Environment

Prerequisites are Python >=3.7.1, Poetry, Tesseract (incl. language data).

# Clone repository
git clone https://github.com/dynobo/normcap.git

# Change into project directory
cd normcap

# Create virtual env and install dependencies
poetry install

# Register pre-commit hook
poetry run pre-commit install

# Run NormCap in virtual env
poetry run python -m normcap

Credits

This project uses the following non-standard libraries:

Packaging is done with:

  • briefcase - converting Python projects into standalone apps

And it depends on external software

Thanks to the maintainers of those nice libraries!

Certification

WOMM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

normcap-0.2.4.tar.gz (380.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

normcap-0.2.4-py3-none-any.whl (387.9 kB view details)

Uploaded Python 3

File details

Details for the file normcap-0.2.4.tar.gz.

File metadata

  • Download URL: normcap-0.2.4.tar.gz
  • Upload date:
  • Size: 380.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.11.0-25-generic

File hashes

Hashes for normcap-0.2.4.tar.gz
Algorithm Hash digest
SHA256 cae2941ffd9f349c3bf50845e7cf64910d1155a83342ae07e9701c58b89a345e
MD5 16d038435f6adc918b1c69fc0dc46cde
BLAKE2b-256 d31cdef38ec484d87db24d44dead28fd41b0b4480db76b20120c7443b4358656

See more details on using hashes here.

File details

Details for the file normcap-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: normcap-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 387.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.11.0-25-generic

File hashes

Hashes for normcap-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c80cb8c28999b9c1e6a097514f719b47ca8bd56e626fe8c54be77b7a2cf2c2
MD5 2a826b0c1684a219f1a4b142a49ce43b
BLAKE2b-256 9995a6a8bcb12c44749b9e80b85ac33629061c3b11db916bc5b9ee1e1d77e85b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page