Skip to main content

Lightning-fast OCR tool for Wayland/Linux. Tesseract by default, with optional AI-powered mode.

Project description

TRex - Text Recognition for Arch Linux

PyPI version Python 3.8+ License: MIT GitHub Platform: Linux Arch Linux Wayland

Lightning-fast OCR tool optimized for Wayland/Hyprland on Arch Linux. Select screen area → Extract text → Copy to clipboard.

OCR: Tesseract OCR: EasyOCR Speed: Lightning Fast GPU: CUDA Ready

Features

  • 🎯 Simple - One command to capture and extract text
  • Lightning Fast - Tesseract by default, results in under 0.5s
  • 🖥️ Wayland Native - Built for modern Linux desktops
  • 📋 Clipboard Integration - Automatically copies extracted text
  • 🎨 Flexible - Fast mode by default, --accurate flag for complex text

Installation

PyPI - Downloads PyPI - Format

# Install system dependencies (Arch Linux)
sudo pacman -S grim slurp wl-clipboard tesseract tesseract-data-eng

# Install TRex (lightweight by default)
pip install trex-ocr

By default, TRex uses Tesseract for blazing-fast OCR. For better accuracy on complex images, install the accurate mode dependencies.

Usage

# Default: Select area → OCR → Copy to clipboard
trex

# OCR image from clipboard
trex -c

# OCR image file
trex -f screenshot.png

# Output to stdout instead of clipboard
trex -o stdout

# Use different language (e.g., German)
trex -l deu

# Use accurate mode for complex/handwritten text
trex --accurate

Performance

  • Default mode: ~0.3-0.5s (Tesseract)
  • Accurate mode: ~2-3s (EasyOCR, downloads AI models on first use)

Languages

Tesseract (default): Uses standard 3-letter codes

  • eng - English (default)
  • deu - German
  • fra - French
  • spa - Spanish
  • jpn - Japanese
  • Install more: sudo pacman -S tesseract-data-[lang]

EasyOCR (--accurate mode):

Configuration

Optional config file at ~/.config/trex/config.json:

{
  "language": "en",
  "gpu": false
}

Set "gpu": true if you have NVIDIA GPU with CUDA support.

Requirements

  • Arch Linux
  • Wayland compositor (tested on Hyprland)
  • Python 3.8+
  • CUDA (optional, for GPU acceleration)

Accurate Mode Setup

For complex images, handwriting, or multiple languages:

# Install accurate mode dependencies  
pip install trex-ocr[accurate] --extra-index-url https://download.pytorch.org/whl/cpu

# Or with GPU support (NVIDIA CUDA)
pip install trex-ocr[accurate,gpu]

Then use trex --accurate for better accuracy at the cost of speed.

License

MIT

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

trex_ocr-1.0.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

trex_ocr-1.0.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file trex_ocr-1.0.1.tar.gz.

File metadata

  • Download URL: trex_ocr-1.0.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for trex_ocr-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b00b14dbf3870426254bddb25e5465b0f52df50d0ac246e1c5e7983647e213e7
MD5 e1c8480ef42ade2b86f66cedb6fd82b6
BLAKE2b-256 0c119e4474611b09b462f0a6110309f7121701ac28b7872a7a7b6bb9f932e498

See more details on using hashes here.

File details

Details for the file trex_ocr-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: trex_ocr-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for trex_ocr-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8afb8b78c8e4a0540717fcec43ee94f4d50637362fbbcd8c5208854804c8d623
MD5 b1f0d7ef3dafdd59cb93a584dd74ca9d
BLAKE2b-256 605ed05731b4ccb647223542412e4b549965ed64800b636409a0d2f1b9be2d2d

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