Experimental
The text in your documents, in reading order
PDFs and plain text, from Python, Node.js, Rust or the command line
Inscriptions of the archipelago
The oldest written records here are carved in stone.
Most are royal decrees, land grants and oaths.
Early ones use a script from South India.
Many still stand where they were carved.
- 4
- 1
- 6
- 2
- 5
- 3
Text in the order you read it
Scored 100% on all six test files
Two columns
The left column first, then the right, the way a paper reads
Tables row by row
Each row stays on one line instead of falling apart into columns
Text stored out of order
Text comes back by where it sits on the page, not where it sits in the file
Words without spaces
When a file places each word on its own, the spaces come back from the gaps
Fast on one core
Measured in CI on every push
Text from 2,000 pages
time, shorter is faster · accuracy- prasasti60 ms100%
- oxidize-pdf191 ms85%
- Poppler pdftotext475 ms100%
- lopdf684 ms69%
- pypdfium2815 ms85%
- PyMuPDF849 ms85%
- pdf_oxide1.05 s83%
pypdf took 2.9 s and pdfminer.six 16.7 s. Accuracy is words in the right order against known text.
How it was measuredOne API for every format
The format is detected from the file itself
pip install prasastiimport prasasti
doc = prasasti.Document("report.pdf")
print(doc.format, doc.page_count)
pages = doc.extract_text(threads=0)Encrypted files (RC4, AES-128, AES-256) and damaged ones with a broken or missing cross-reference table
Plain text
UTF-8, UTF-16 and Windows-1252, told apart from the bytes, with form feeds as page breaks
Next: DOCX and HTML
New formats arrive behind the same Document API, so your code stays the same