$ show T-duality/PillOCR-python
PillOCR is a desktop OCR application that monitors the clipboard for images, sends them to configured LLM APIs (OpenAI, Volcengine, or custom endpoints), processes the returned markdown content (particularly converting LaTeX delimiters), and places the result back in the clipboard. Built with Python/tkinter, it features system tray integration, global hotkey support, and cross-platform notifications. The application follows a modular architecture with separate concerns for image encoding, markdown processing, configuration management, and platform-specific utilities.
The LLM identified 3 files worth highlighting for reuse:
Provides a clean abstraction for global hotkey registration that works across Windows (actual implementation) and macOS/other platforms (stub implementation). Supports both regular application hotkeys and specialized screenshot hotkeys. Demonstrates skill in defining clear interfaces while handling platform differences gracefully.
Abstracts cross-platform desktop notifications using the plyer library, with automatic background threading to prevent UI blocking. Provides convenience methods for success, error, and processing notifications. Shows good practice in separating concerns and maintaining UI responsiveness.
Handles conversion between different LaTeX delimiter formats (e.g., converting \[ \] to $ $ or $$ $$). Features robust regex-based processing that cleans up extra delimiters and handles both inline and block formulas. Demonstrates skill in text processing edge cases while maintaining a simple, reusable interface.