Psyduck
Psyduck is a small Python SDK for turning PDFs into agent-ready structured documents.
It is intentionally SDK-only: import it from Python, run Psyduck().process(...), and inspect the returned document, profile, quality report, and exported artifacts.
Install
pip install psyduck
Development install:
pip install -e ".[dev]"
Python API
from psyduck import Psyduck
duck = Psyduck()
result = duck.process("report.pdf", goal="rag", mode="balanced", return_content=True)
if result.quality.needs_review:
for warning in result.quality.warnings:
print(warning.code, warning.message)
for block in result.document.blocks:
print(block.page, block.text)
Output Directory
output/report-<timestamp>-<id>/
run.json
profile.json
document.md
document.json
quality.json
tables/
assets/
pages/
SDK Contract
- Default extraction uses PyMuPDF.
process()always writes Markdown, JSON, profile, quality, and run metadata.return_content=Falsekeeps large document content out of the immediate result.load_result(output_dir)reloads a previous SDK run.- Custom extractors can be supplied through
extractor_registryand requested withprocess(..., extractors=[...]). tables="force"andocr="force"reportneeds_table_adapter/needs_ocr_adapterwarnings unless a caller-provided extractor handles that work.
Custom Extractors
from psyduck import Psyduck
from psyduck.extractors.base import ExtractorOutput
from psyduck.extractors.pymupdf import PyMuPDFExtractor
class MyExtractor:
def extract(self, file_path, pages=None):
return ExtractorOutput(source="my_extractor")
duck = Psyduck(
extractor_registry={
"pymupdf": PyMuPDFExtractor,
"my_extractor": lambda: MyExtractor(),
}
)
result = duck.process("report.pdf", extractors=["pymupdf", "my_extractor"])
Agent Policy
- Always call
process()before answering questions about PDF contents. - Check
result.qualitybefore using extracted content. - Use Markdown for summaries and JSON for page-aware answers.
- Do not claim complete extraction when
needs_reviewis true.
Metadata
Release files for psyduck 0.1.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 | Provenance | |
|---|---|---|---|---|
| psyduck-0.1.0.tar.gz | 32.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| psyduck-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.2 kB
Release files / psyduck-0.1.0.tar.gz
| Download URL | psyduck-0.1.0.tar.gz |
|---|---|
| Size | 32.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e1c2785695d1e5aa70f7151994e046fe5afee0e7ec6a392de34f71ae3f0bb06
|
|
BLAKE2b-256 checksum How to use checksums |
bd1ea2d110466db7c43aa82f17d235bb1fe59ffd20a741b91e82859c071a04f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / psyduck-0.1.0-py3-none-any.whl
| Download URL | psyduck-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb4ee174116603a02ff588c6a3655b453773569b939dae760776c1bca06f3913
|
|
BLAKE2b-256 checksum How to use checksums |
1216c914a1b375838cbf150a9c9835ad9aafeac1facaed75b4bfb2f88e0f4f8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for psyduck 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.