Repository navigation
Releases
Releases · Particle-Academy/fine-print-py
v0.1.0
The first release, and it is the reader only: there is no writer and no
renderer yet. It is a port of PHP fine-print 0.7.0's reader
(PHP_REFERENCE = "0.7.0"), held to PHP by a live oracle rather than by claim.
Pre-1.0: the API may still change in a minor release.
Added
read(data, *, policy, threshold, excerpts, limits, words)and
read_unredacted(data, *, threshold, excerpts, limits, words): PHP's
Agent::read/Agent::readUnredacted, with the same result shape, the same
redaction policies (redactby default,flag,discard), thresholds,
findings, notices and refusals ({"ok": false, "refused": {reason, message}}).
words=Truegives each page{text, x0, x1, top, bottom}boxes, redacted as
the page text is (the pdfplumberextract_wordsshape).page_count(data, limits), which raisesRefusedExceptionas PHP's does.Document, the host's raw view:open(),pages(),page_text(n),
text(n),page_words(n),page_text_with_words(n),metadata(),
xmp(),outline(),annotations(n),active_content(),
encryption(),warnings(),repaired(),version().- Every PHP guard, with PHP's limits, reasons and messages: file bytes,
objects, nesting depth, stream bytes, the decompression ratio and its floor,
total decoded bytes, operators, form depth, pages, time and memory. One
refusal type,RefusedException, and the 12 PHP reasons. - Text extraction as PHP's: Flate, LZW, ASCII85, ASCIIHex and RunLength with
the PNG and TIFF predictors; simple and Type0 fonts, the four base encodings,
/Differencesand glyph names,ToUnicodeand encoding CMaps;TJ
kerning and the layout's word and paragraph gaps; the CTM,/Rotateand the
crop box; form XObjects; hidden, white, tiny and off-page text. - Empty-password decryption (RC4, AES-128, AES-256; R2 to R6) with our own
RC4 and AES, the active-content scanner and the agent-read guard. tests/test_parity_php.py: PHP fine-print and this port read the same 801
files (harvested from PHP's own test suite by
scripts/harvest_php_corpus.php) through six read variants and must agree,
words within 1e-6 pt. A missing PHP fails the suite.
Changed
- CI checks the PHP reference out at
v0.7.0(wasv0.5.0).
Known differences from PHP
- Memory is ACCOUNTED, not measured (plan decision D7), so a read near
memoryBytesmay refuse at a slightly different point; PHP's second check,
the headroom undermemory_limit, has no Python counterpart. - A page-tree warning about a direct (unreferenced) node names it by an object
id, which differs between runtimes. - Python bounds two loops PHP leaves unbudgeted (reported upstream): the
painted-ground lookup behind white-text detection, and a cross-reference
stream's rows when/Indexholds a non-integer count.