GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ThalesMMS/ReadMyPaper-go: Local app that converts scientific PDFs into listenable audio by using Docling layout extraction, reading-order repair, section filtering, optional LLM cleanup, notation verbalization, and Piper/Kokoro TTS.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
cmd
cmd
 
 
docs
docs
 
 
internal
internal
 
 
scripts
scripts
 
 
.DS_Store
.DS_Store
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
FyneApp.toml
FyneApp.toml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
ganeshan-et-al-2013-imaging-of-primary-and-secondary-renal-lymphoma.pdf
ganeshan-et-al-2013-imaging-of-primary-and-secondary-renal-lymphoma.pdf
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
requirements-tts.txt
requirements-tts.txt
 
 

Repository files navigation

ReadMyPaper — Go/Fyne

Local desktop app that converts scientific PDF articles into cleaned text and WAV audio. This implementation ports the ReadMyPaper-py workflow to Go, with a native Fyne interface and modular organization for extraction, cleaning, persistence, optional LLM review, and speech synthesis.

Features

  • PDF selection through a desktop interface;
  • PDF signature, size, and page-count validation;
  • local text and coordinate extraction from PDFs in Go;
  • heuristic reading-order repair for multi-column articles;
  • spatial filtering of content associated with figures, tables, and captions;
  • scientific-article cleaning, including front matter, references, acknowledgements, appendices, and numeric citations;
  • optional preservation of titles and headings;
  • automatic English or Brazilian Portuguese detection;
  • scientific-notation verbalization for natural listening;
  • optional block review through a local OpenAI-compatible endpoint;
  • local TTS with Piper (fast) or Kokoro (quality), with Kokoro fallback to Piper;
  • concurrent job queue, progress tracking, persistent history, and restore after restart;
  • local playback and export of the WAV, cleaned text, and original PDF;
  • optional TTL retention and safe deletion of a job's artifacts.

Architecture

cmd/readmypaper/          Fyne app entry point
internal/app/             desktop interface and WAV playback
internal/pdfextract/      positioned PDF extraction in Go
internal/cleaner/         reading order, filters, and verbalization
internal/llm/             OpenAI-compatible client with per-batch fail-open behavior
internal/tts/             voice catalog, voice download, and Piper/Kokoro backends
internal/jobs/            concurrent store, execution, and persistence
internal/pipeline/        processing orchestration
internal/config/          directories, limits, and environment variables
internal/domain/          shared types
internal/util/            files, URLs, IDs, and WAV validation

The app core, interface, PDF processing, cleaning, and orchestration are implemented in Go. Piper and Kokoro are invoked through small Python bridges embedded in the binary because the reference runtimes for those models are distributed as Python packages. No web server is required.

A more detailed technical description is available in ARCHITECTURE.md.

Requirements

Common

  • Go 1.24.1 or newer;
  • Python 3.10-3.12 for the TTS backends when running from source; the self-contained macOS package already embeds Python 3.12 and the TTS packages;
  • internet access the first time each voice/model is used; after that, artifacts are kept in the local cache.

Linux (Debian/Ubuntu)

Install the Fyne build dependencies and, for Kokoro, espeak-ng:

sudo apt update
sudo apt install -y gcc libgl1-mesa-dev xorg-dev libxkbcommon-dev espeak-ng

For playback through the Play button, make sure at least one of these commands is available: ffplay, paplay, or aplay.

macOS

xcode-select --install
brew install espeak-ng

Playback uses afplay, which is already provided by macOS.

Windows

Use Go with a C compiler compatible with Fyne, such as the MSYS2 MinGW-w64 toolchain. For Kokoro, also install eSpeak NG. Playback uses PowerShell and System.Media.SoundPlayer.

TTS Backend Installation

When using the macOS package generated by make package-macos, skip this section: the Python runtime and the packages from requirements-tts.txt are inside the .app.

Create a virtual environment in the project directory:

Linux/macOS

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-tts.txt

Windows PowerShell

py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements-tts.txt

The app looks for python3, python, or py -3. To pin the virtual-environment interpreter:

export READMYPAPER_PYTHON_BIN="$PWD/.venv/bin/python"

In PowerShell:

$env:READMYPAPER_PYTHON_BIN = "$PWD\.venv\Scripts\python.exe"

Run

go run ./cmd/readmypaper

Print the version without opening the interface:

go run ./cmd/readmypaper --version

Build

mkdir -p bin
go build -trimpath -o bin/readmypaper ./cmd/readmypaper

On Windows, use bin/readmypaper.exe as the destination. To package with the metadata from FyneApp.toml:

go install fyne.io/tools/cmd/fyne@latest
fyne package

Self-Contained macOS Package

Generate dist/ReadMyPaper.app with the Go binary, standalone Python, and installed Piper/Kokoro backends:

make package-macos

Explicit architectures:

scripts/package-macos.sh --arch arm64
scripts/package-macos.sh --arch x86_64
scripts/package-macos.sh --arch universal

The script downloads the relocatable Python build from astral-sh/python-build-standalone, installs requirements-tts.txt directly into Contents/Resources/python, and assembles the bundle with Info.plist, Icon.png, and CFBundleIdentifier=io.github.thalesmms.readmypaper. For --arch universal, it creates a universal Go binary and includes separate Python runtimes in python-arm64 and python-x86_64; the build host must be able to run both Pythons to install the wheels. The arm64 build validated on 2026-06-24 produced an .app of about 854 MB, mostly because of the current Kokoro dependencies.

Signing and notarization are optional:

CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)" \
NOTARY_PROFILE="readmypaper-notary" \
make package-macos

Without a Developer ID, the local app is generated without a distribution signature; when sharing the bundle, the user may need to authorize it in Security & Privacy. Voices and models are still downloaded on first use and saved in ~/Library/Caches/ReadMyPaper, keeping the bundle smaller.

Usage

  1. Open New job and select a PDF.
  2. Choose the language, voice, engine, and speed.
  3. Adjust the cleanup rules.
  4. Optionally enable a local LLM endpoint compatible with /chat/completions.
  5. Click Process PDF.
  6. Track the job in the Jobs tab and save or play the results.

Piper downloads only the selected voice on first use. Kokoro manages its own model cache. When Kokoro fails, the pipeline automatically tries Piper and reports the engine that was actually used.

Optional LLM Endpoint

The URL can be provided as 127.0.0.1:11434/v1 or as a complete HTTP(S) URL. The client appends /chat/completions, rejects embedded credentials, query strings, and fragments, limits response size, and does not follow redirects.

The API key can be typed in the API key field in the LLM section. This value is used only for the running job and is not written to metadata.json. READMYPAPER_LLM_API_KEY still provides the initial field value.

The model receives text blocks and layout metadata in bounded batches. The output may only keep, drop, or reorder blocks; textual rewriting is deliberately ignored. On network errors or invalid responses, the batch is kept unchanged.

Data Directories

Platform Data Cache
Linux ~/.local/share/ReadMyPaper ~/.cache/ReadMyPaper
macOS ~/Library/Application Support/ReadMyPaper ~/Library/Caches/ReadMyPaper
Windows %LOCALAPPDATA%\ReadMyPaper %LOCALAPPDATA%\ReadMyPaper\Cache

Copied PDFs are stored in uploads/<job-id>. Text, audio, and metadata.json are stored in outputs/<job-id>. When TTL is enabled, startup also removes old orphaned directories left by interrupted jobs or invalid metadata.

Environment Configuration

Variable Default Purpose
READMYPAPER_DATA_DIR platform data directory PDFs and results
READMYPAPER_CACHE_DIR platform cache directory voices, models, and bridges
READMYPAPER_MAX_WORKERS 2 jobs processed simultaneously
READMYPAPER_MAX_UPLOAD_BYTES 52428800 maximum PDF size
READMYPAPER_MAX_PDF_PAGES 200 maximum page count
READMYPAPER_SPEECH_RATE_MIN 0.5 minimum speed in the UI/internal API
READMYPAPER_SPEECH_RATE_MAX 2.0 maximum speed in the UI/internal API
READMYPAPER_MAX_PENDING_JOBS 10 pending or running jobs
READMYPAPER_JOB_RETENTION_HOURS 0 TTL applied at startup; 0 disables it
READMYPAPER_LLM_URL empty default OpenAI-compatible URL
READMYPAPER_LLM_MODEL empty model sent to the endpoint
READMYPAPER_LLM_ENABLED false starts with the LLM option checked
READMYPAPER_LLM_API_KEY apikey bearer token for the local endpoint
READMYPAPER_PYTHON_BIN Python embedded in the .app, then PATH interpreter for the TTS bridges

Invalid numeric values use the default, except for structurally impossible limits, which prevent startup with an explicit message.

Tests And Quality

go test ./...
go vet ./...

In environments without OpenGL/X11, such as headless CI:

go test -tags ci ./...
go build -tags ci -o bin/readmypaper-ci ./cmd/readmypaper

The tests cover multi-column ordering, spatial filtering, scientific cleaning, verbalization, PDF extraction, LLM, voice catalog, persistence, concurrent store behavior, pipeline behavior, and Fyne interface construction.

Privacy And Security

  • there is no telemetry;
  • PDFs and results remain in the app's local directories;
  • the network is used to download models/voices and only when the optional LLM is enabled;
  • deletions are restricted to data directories and validated identifiers;
  • restored metadata paths are accepted only inside the uploads root;
  • PDF content is not passed through shell arguments: the bridges receive a temporary JSON file and are executed without a shell.

See SECURITY.md for the trust model.

Known Limitations

  • Image-only PDFs are not processed with OCR; the app reports that the document requires OCR.
  • Native extraction uses glyph, font, and geometry heuristics. PDFs with nonstandard encoding, highly ornamental layouts, or borderless tables may require tuning.
  • The playback button depends on a WAV player already available on the system.
  • First use can be slow because TTS models must be downloaded and initialized.

License

GPL-3.0-or-later, continuing the reference Python project. See LICENSE.

About

Local app that converts scientific PDFs into listenable audio by using Docling layout extraction, reading-order repair, section filtering, optional LLM cleanup, notation verbalization, and Piper/Kokoro TTS.

Topics

pdfscientific-paperstts

Resources

Readme
License

Contributing

Contributing

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.