Skip to main content

Negar-GUI

PyPI code size GitHub language count GitHub top language GitHub forks GitHub license GitHub stars GitHub issues Downloads Downloads GitHub last commit

Graphical User interface for negar

Negar's English view Negar's Persian view

Features

  • Persian text cleanup with live side-by-side or comparative (diff) view and configurable editing options.
  • Screen reader (OCR): drag a rectangle over anything on screen, or use an image from the clipboard, and read its text into the editor (Persian, English and German). See Screen reader.
  • AI grammar fix: send the text to an LLM (Gemini, Groq, OpenRouter, OpenAI, or free Pollinations) with your own prompts and a usage report. See AI grammar fix.
  • Read, fix, copy: OCR a screenshot, clean it with Negar, and polish it with the AI button, all in one window.
  • QR code of the result, interactive clipboard, Persian keyboard on startup, light/dark themes.

Installation

PyPi

python-negar is available on PyPi:

$ pip install negar-gui

Git

You can retrieve the latest stable changes from the GitHub server:

$ git clone https://github.com/javadr/negar-gui.git
$ cd negar-gui
$ python setup.py install

Zip, Tarball

You can download the latest tarball.

*nix

Get the latest tarball & install:

$ wget -O negar-gui-master.tar.gz https://github.com/javadr/negar-gui/archive/master.tar.gz
$ tar xvzf negar-gui-master.tar.gz && cd negar-gui-master
$ python setup.py install

Windows

Download the latest zip archive.

https://github.com/javadr/negar-gui/archive/master.zip

Decompress it, and run the following command in the root directory of negar-gui

$ python setup.py install

Requirements

The GUI is relied on python-negar as well as PyQt5/6, pyperclip, pyuca, redlines, regex, requests, qrcode, docopt, Image, pyqtdarktheme-fork, and toml. If you want to just run it by calling the script, you need to install its dependencies.

$ pip install python-negar PyQt5 PyQt6 pyuca pyperclip redlines regex requests qrcode docopt Image pyqtdarktheme-fork toml

Usage

Just use one of the following in your terminal.

$ negar-gui

or simply

$ negar

Persian keyboard on startup

If a Persian keyboard layout is installed, Negar switches to it when it starts and switches back when it closes (turn it off in Settings → Persian Keyboard on Startup). This works on Windows, macOS, KDE Plasma, Sway and X11 desktops. GNOME has no built-in way for apps to change the layout, so there you need the Shyriiwook extension.

Screen reader

Edit → Read Text from Screen (Ctrl+Shift+O) lets you drag a rectangle over anything on screen; the text is recognised with Tesseract and put into the input editor. Edit → Read Text from Clipboard Image (Ctrl+Alt+O) does the same for an image you copied (e.g. a screenshot). Pick the language in Edit → OCR Language: fewer languages are more accurate. Persian recognition is Tesseract's weak spot, so check the result; the AI button below can help fix recognition mistakes. Your language choice is remembered between runs.

OCR → Run Prompt after OCR binds one of your AI prompts to both OCR commands: after the text is read, that prompt runs on it automatically (for example to fix recognition mistakes) and the result lands in the output box. Choose None to just read the text. The choice is remembered, and the menu follows the GUI language.

The standalone executable includes Tesseract with English, Persian and German data. With a pip install you need your own: pacman -S tesseract tesseract-data-fas tesseract-data-eng tesseract-data-deu, or apt install tesseract-ocr tesseract-ocr-fas tesseract-ocr-eng tesseract-ocr-deu. On Wayland the screenshot is taken through the desktop's screenshot portal (GNOME and KDE have it; on other compositors install xdg-desktop-portal-wlr).

Read aloud

Speech → Read Aloud (Ctrl+Shift+R, or the speaker button in the toolbar) reads the selection, or the whole text, of the box you last worked in, in Persian, offline. Each box also has its own speaker button in its top-left corner that reads just that box. Nothing is sent to a cloud, and the sentence being read is highlighted. While reading, the buttons turn into Stop; press again to stop. The standalone executable includes the Tiny voice (about 30 MB, no download, nothing to install); the other voices need a pip install. Pick the voice in Speech → Voice; the choice is remembered:

Voice Install Download Notes
Tiny: Tiny Ava pip install onnxruntime numpy or pip install "negar-gui[tts-tiny]" about 30 MB CPU only, no torch, not gated, no login. One voice (Parisa), plainer quality. CC BY 4.0; public use must display "Powered by tiny-ava (Mehdi Allahyari / OncillaAI)".
Fast: Cilla Mini (default) pip install --extra-index-url https://download.pytorch.org/whl/cpu torch "pocket-tts>=4.0.1" or pip install --extra-index-url https://download.pytorch.org/whl/cpu "negar-gui[tts]" about 112 MB Runs on the CPU, loads in seconds, about 1 GB RAM. CC BY-NC 4.0.
Balanced: Cilla Lite same packages as Fast about 450 MB Same engine as Fast (CPU), a bigger model. CC BY-NC 4.0.
High quality: Chatterbox Farsi pip install chatterbox-tts "setuptools<81" or pip install "negar-gui[tts-hq]" about 3 GB Better voice, but slow to load; wants an NVIDIA GPU (on the CPU it is much slower than real time). Non-commercial license; public use must display "Powered by OncillaAI Chatterbox Farsi"; output carries an inaudible watermark.

Python 3.10+. Either model is gated: open its page and accept the terms, create a Read token at huggingface.co/settings/tokens, then run hf auth login --token <your token>. The model downloads the first time you press Read Aloud, with a progress bar, and loads in the background when Negar starts. Only Persian letters are read: write English words and numbers in Persian.

AI grammar fix

The AI button sends the input text (typed, pasted or read by the screen reader) to a language model and shows the model's answer in the output pane. Choose or edit the instruction in Assistant → Manage Prompts..., and see requests and success rate per provider and prompt in Assistant → Usage Report....

The AI button works without setup through Pollinations, which is free but slow and rate-limited. For better results, open Assistant → AI Provider..., pick a provider and paste your own API key. Google Gemini, Groq and OpenRouter give free keys, and OpenAI is paid. Keys are stored in plain text in the settings file (on Linux and macOS the file is made readable only by your user).

Docker

A Docker image is available on Docker Hub:

$ docker pull javadr/negar-gui

Build it locally:

$ make docker-build

Run on X11

$ docker run --rm \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v $HOME/.config/negar-gui:/home/negar/.config/negar-gui \
    javadr/negar-gui

Run on Wayland

$ docker run --rm \
    -e QT_QPA_PLATFORM=wayland \
    -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY \
    --device /dev/dri \
    -v $HOME/.config/negar-gui:/home/negar/.config/negar-gui \
    javadr/negar-gui

Auto-detect (via Makefile)

$ make docker-run

Metadata

Release files for negar-gui 1.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for negar-gui 1.6.1
File Size Uploaded Provenance Actions
negar_gui-1.6.1.tar.gz 255.7 kB Without provenance Details for negar_gui-1.6.1.tar.gz

Release files / negar_gui-1.6.1.tar.gz

Download URL negar_gui-1.6.1.tar.gz
Size 255.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad567b4e4aa2af7ed110c60a12b555a5cd7ed824b4ff74de995df8b4c876aea6
BLAKE2b-256 checksum
How to use checksums
db2377cf3727b4685655bddef990e5c4754cada0cb097ce4ba1d9e79f7d03658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Security for negar-gui 1.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.6.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page