Skip to content

RazorBackRoar/Papyrus

Repository files navigation

Papyrus

CI Version License: MIT Apple Silicon PySide6

██████╗  █████╗ ██████╗ ██╗   ██╗██████╗ ██╗   ██╗███████╗
██╔══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝██╔══██╗██║   ██║██╔════╝
██████╔╝███████║██████╔╝ ╚████╔╝ ██████╔╝██║   ██║███████╗
██╔═══╝ ██╔══██║██╔═══╝   ╚██╔╝  ██╔══██╗██║   ██║╚════██║
██║     ██║  ██║██║        ██║   ██║  ██║╚██████╔╝███████║
╚═╝     ╚═╝  ╚═╝╚═╝        ╚═╝   ╚═╝  ╚═╝ ╚═════╝ ╚══════╝

Native macOS HTML-to-PDF converter. Paste HTML or plain text, preview in your browser, and export a clean PDF — powered by Playwright Chromium.


Features

  • HTML & Plain Text Input — accepts raw HTML, readable article extracts, or plain text
  • Browser Preview — open the current editor content in your browser before exporting
  • Chromium-Backed PDF — Playwright renders the page exactly as a browser would
  • Readability Extractionreadability-lxml strips navigation and ads for clean article output
  • Light / Dark Theme — choose your PDF print style at export time
  • Apple Silicon Native — arm64 build optimized for M1/M2/M3/M4 chips

Installation

  1. Download the latest Papyrus.dmg from Releases
  2. Open the DMG and drag Papyrus.app to /Applications
  3. First launch — right-click the app → Open to bypass Gatekeeper on the ad-hoc signed build

Note: Playwright Chromium is bundled with the app. No separate browser installation required.


Usage

  1. Paste or Drop — HTML, plain text, or a local HTML file export
  2. Preview (optional) — click Preview to open the content in your browser
  3. Export — click Export PDF and choose a save location

Export Flow

Input (HTML / plain text)
  ↓
readability-lxml extracts readable content
  ↓
HTML pre-processing and print CSS injection
  ↓
Playwright Chromium renders and exports PDF
  ↓
dist/Papyrus.dmg (US Letter, light or dark theme)

Development

Requirements

  • Python 3.14
  • macOS 12.0+
  • uv

Setup

git clone https://github.com/RazorBackRoar/Papyrus.git
cd Papyrus
uv sync
uv run playwright install chromium
uv run python -m papyrus.main

Build

razorbuild Papyrus
# Output: dist/Papyrus.dmg

Lint & Test

uv run ruff check .
uv run ty check src --python-version 3.14
uv run pytest tests/ -q

Project Structure

Papyrus/
├── src/papyrus/
│   ├── core/
│   │   ├── app.py          # Pipeline orchestrator
│   │   ├── renderer.py     # Playwright Chromium PDF generation
│   │   ├── parser.py       # Readability content extraction
│   │   └── html_cleaner.py # HTML pre-processing
│   ├── ui/
│   │   ├── editor.py       # Input editor widget
│   │   └── highlighter.py  # Syntax highlighter
│   └── main.py             # Entry point
├── assets/
├── tests/
└── Papyrus.spec

Dependencies

Package Purpose
PySide6 Qt6 GUI framework
playwright Chromium-backed PDF rendering
readability-lxml Readable content extraction
beautifulsoup4 HTML parsing

License

MIT License — see LICENSE for details. Copyright © 2026 RazorBackRoar

Runtime Requirements

For users:

  • Download the macOS .dmg or .app release. Python does not need to be installed.

For developers:

  • Primary development/build target: Python 3.14 with uv.
  • Source compatibility goal: Python 3.12-3.14 (best effort).
  • Setup: uv sync
  • Run: uv run python -m papyrus