readablepdf
readablepdf converts image-only PDFs into searchable and selectable PDFs by adding an OCR text layer while preserving page visuals.
How it works
- Render each page to a PNG (
pdf2imagebacked by Poppler). - OCR each page with Tesseract in PDF mode (image layer + invisible text layer).
- Merge all OCR page PDFs into one output PDF.
All intermediate files are written inside an OS temporary directory and removed automatically.
System dependencies (Linux + macOS)
You need these binaries on the machine where you run readablepdf:
tesseractpdftoppm(from Poppler)
Ubuntu/Debian:
sudo apt update
sudo apt install -y tesseract-ocr poppler-utils
macOS (Homebrew):
brew install tesseract poppler
If you need languages beyond English, install matching Tesseract language packs.
Install and run with pipx
Once published on PyPI, you can run it directly without managing a virtualenv:
pipx run readablepdf input.pdf
Custom output/language/DPI:
pipx run readablepdf input.pdf -o output_ocr.pdf --lang eng --dpi 200
Local development
python3 -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
ruff check .
ruff format --check .
pytest -q
python -m build
GitHub Actions
CIworkflow: lint + format check + tests + build on Ubuntu and macOS.Publish to PyPIworkflow: runs on GitHub Release publish (and manual trigger).
GitHub configuration needed for publish
- Create repository secret:
PYPI_API_TOKEN. - Set it to a PyPI API token with upload permission for this project.
- (Optional but recommended) create a protected environment named
pypiand require approvals.
Release flow
- Merge to
main. - Create a Git tag/release (for example
v0.1.1). Publish to PyPIworkflow uploads artifacts to PyPI with version derived from that tag.
Metadata
Release files for readablepdf 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| readablepdf-0.2.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| readablepdf-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / readablepdf-0.2.0.tar.gz
| Download URL | readablepdf-0.2.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2096fa5f11b9c4933ee1f3fe816c660f6c678fffdee21e08831c445e9b43dd70
|
|
BLAKE2b-256 checksum How to use checksums |
c0b18e20619e395c1b78e4d8434f13e9624ab413aed0281693bfda7f6253a354
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency logRelease files / readablepdf-0.2.0-py3-none-any.whl
| Download URL | readablepdf-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c94fd62276552b2bd51d2da177f94a3f27d24eca4c85604a1455f028a350fb99
|
|
BLAKE2b-256 checksum How to use checksums |
30ac3f964156ec064f4f9698bee5587d72b4d9cedf4b55a8358608e51c5c4c02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency log