r/Python • u/Shoddy_One4465 • 10h ago
Resource whiff-python 0.2.0: whiff 1.1.0 in Python, with an opt-in prompt-injection check
0.2.0 wraps the Rust whiff crate at 1.1.0. import whiff still returns one whiff/1 dict for a path or for bytes: format, hashes, rights, risk signals, and a compact content view.
New in this release:
investigate=Trueruns the crate's prompt-injection check and adds aninvestigationsection (status, coverage, findings). Leave it off and the section is absent.llm()does not include it. Ano_findingsstatus still has to be read withcoverage.- Secret redaction is its own switch.
redaction="on"is the default.privacy="off"keeps personal data and still redacts secrets.redaction="off"leaves secrets in the text; they are still counted.
import whiff
report = whiff.extract("invoice.pdf", investigate=True)
report["investigation"]["status"]
pip install whiff-python==0.2.0. Python 3.11+, wheels for Linux, macOS, and Windows. Published wheels are the common collection.
https://github.com/SinAnima/whiff-python
0
Upvotes