Feanor
Turns scanned or photographed books, thesis PDFs, Word documents and PowerPoint presentations in Spanish into Markdown, recording where the text of each page comes from.
Cite this software
Description
Feanor turns scanned or photographed books, thesis PDFs, Word documents and PowerPoint presentations in Spanish into Markdown, so they can be read, searched or handed to an AI. With photos of books, it straightens pages that curve towards the spine before reading them.
- Version: 0.6.3 (2026-11-25). History in CHANGELOG.md (in Spanish).
- Name: the tool is called Feanor; the Python package is
feanor_el_aplasta_libros(on PyPI,feanor-el-aplasta-libros). The package calledfeanoron PyPI is a different project. - Status: research software, in use in the author's own study of Spanish-language theses.
- Most important: Feanor does not produce verified text. Figures, doses, quotations and names must always be checked against the original.
- Language: the code and its messages are in Spanish; the README and docs/VALIDATION.md are in English.
What it does
| Input | What Feanor does | Output |
|---|---|---|
| PDF with text (born-digital or with an earlier OCR layer) | Copies the text it already has, without OCR, and records where each page's text comes from | .md + .json |
| Scanned PDF or photos of a book | Prepares, flattens and OCRs the pages in Spanish | .md + .json + flattened PDF and OCR'd PDF |
Mixed PDF (in batch mode --auto) | Native text where there is any, and OCR without flattening only on the image-only pages | .md + .json |
Word (.docx) | Copies the text in order, with headings, lists, tables and footnotes | .md + .json |
PowerPoint (.pptx) | Copies the text of each slide and its notes; OCRs images that contain text | .md + .json |
| A whole folder | One result per file plus a batch summary | one folder per file + _lote.md, _lote.csv, _lote.json |
Before anything else, Feanor checks where the text of each page comes from (digital, earlier OCR, uncertain, scanned or empty) and chooses the route: straight to Markdown in seconds when the pages already have text, or flattening and OCR when they are photos.
The .json of each run records the source file with its SHA-256; the Feanor version and git commit; the versions of PyMuPDF, Tesseract (and the SHA-256 of its language model), OCRmyPDF and Ghostscript; for each page, its type and the measures and thresholds behind the decision; and the raw text of each page, with no cleaning at all.
Installation
python -m pip install feanor-el-aplasta-libros
External requirements: Tesseract with Spanish data, OCRmyPDF and Ghostscript. Step-by-step instructions for Windows are in the README.
Usage
feanor "libro.pdf"
feanor "trabajo.docx"
feanor "clase.pptx"
feanor "C:\path\thesis_folder" --auto
Batch mode processes a whole folder of theses: one result per file, a references section located by its heading, a body for lexical analysis (--cuerpo), metadata joined from a CSV with a year lock (--metadatos, --anios), and a forced OCR comparison on a random sample of born-digital PDFs (--comparar-ocr).
Verification
- Automated tests: 45 in version 0.6.3, run on GitHub on every change with Tesseract, OCRmyPDF and Ghostscript installed. No copyrighted book goes into the repository.
- Measurements with real material (books, phone photos, theses), in CALIBRACION.md and in each version of the CHANGELOG, with the material, the date and what they do not guarantee.
docs/VALIDATION.md maps each measured result and each claimed behaviour to the test or measurement behind it, and lists what is not validated.
What was measured
Tests on 2026-11-13 with a book photographed with a phone (14 pages):
- Flat pages: OCR is almost perfect without flattening.
- Pages curving towards the spine: without flattening, OCR is useless. Flattened and read in book mode, six out of seven came out legible and in order; on the page checked by hand, about 97% of the words were correct.
- Language: with
-l spa+eng, about 40% of the accents and ñ were lost; with-l spathey all came back.
Known limits (selection)
- No verified text: doses, reference values, names and any figure used in a decision or a publication must be checked against the original. The same applies if the
.mdis given to an AI. Every.mdcarries this warning. - Very tight curve near the spine: the first lines may stay slightly curved; the page is flagged «REVISAR A MANO» with a provisional threshold.
- Errors without curvature (shadow, low resolution) are not flagged.
- Different results on different computers: on difficult pages the flattening is unstable; each run records its environment so runs can be compared.
- Tables of contents come out worst; they are detected, left uncleaned and flagged.
- Two-column documents need
--modo auto. - Numbers, symbols and DOIs: OCR confuses them. OCR is for reading and searching; figures and quotations are always checked in the image.
The full list is in the README.
Credits
Feanor does not do OCR itself and does not invent the flattening. It relies on page-dewarp (Louis Maddox, after Matt Zucker 2016), OCRmyPDF, Tesseract, PyMuPDF, OpenCV, python-docx and python-pptx. What Feanor contributes: the complete workflow and the choice of route by page type, the automatic crop of the flattened page, the fix to page-dewarp's bounding box near the spine, the OCR settings tested on books in Spanish, the review marks in the Markdown, and the batch mode for thesis corpora.
How it was made
Author: Carlos Eduardo Ravello Joo. The author defined the problem, directed the development and validated the results with real material. Claude (Anthropic) was used as a programming assistant.
Licence and citation
Feanor's code is MIT (LICENSE). Dependencies keep their own licences; PyMuPDF and Ghostscript are AGPL-3.0 or Artifex commercial licence, so anyone who redistributes Feanor together with PyMuPDF, or offers it as a network service, must also comply with that licence.
Ravello Joo, C. E. (2026). Feanor (Version 0.6.3) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.24535094
All versions: DOI 10.5281/zenodo.24522078.