Metadata-Version: 2.4
Name: paperparse-client
Version: 0.1.0
Summary: Thin, dependency-free client for the paperparse scientific-PDF extraction service.
Author: Boris Bolliet
License: MIT
Project-URL: Homepage, https://paperparse.app
Keywords: pdf,ocr,figures,scientific-papers,arxiv
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# paperparse-client

A thin, **dependency-free** Python client for the [paperparse](https://paperparse.app)
service — turn a scientific-paper PDF into structured output (figures + captions +
sub-panels, tables, equations, body markdown) from any backend, without pulling in
paperparse's heavy dependencies or source.

```bash
pip install paperparse-client
```

```python
from paperparse_client import PaperparseClient

pp = PaperparseClient(
    api_key="denario_live_...",          # a denario-web key (issue at denario-web.vercel.app)
    client_ref="skepthical:run_abc123",  # opaque per-run id — REQUIRED for B2B keys
)
res = pp.parse("paper.pdf", out_dir="run/")   # uploads, parses, downloads artifacts

print(res["title"], res["n_figures"], res["cost"]["cost_usd"])
for f in res["figures"]:
    print(f["label"], f["path"], f["caption"][:60])   # f["path"] = local PNG (out_dir set)
```

- **Stdlib only.** No `requests`, no paperparse code — just an HTTP wrapper.
- **`client_ref` is required.** An opaque identifier the *caller* generates (a run id or a
  user hash). It's used only for attribution (stamped on the service's trace); paperparse
  never inspects it. B2B API keys reject calls that omit it.
- **Async + robust.** Uses the service's job flow (upload → run → poll), so a long parse
  survives a dropped connection.
- **`out_dir`** downloads everything locally — `document.md`, `figures.json`, and each
  crop — and adds a local `path` to every figure/panel/table/equation in the result.

The result shape is documented in the paperparse repo's `CONTRACT.md` (versioned via
`schema_version`). Upload is subject to the service's 32 MB request cap (papers are
virtually always under it).
