Metadata-Version: 2.5
Name: z-parser-sdk
Version: 1.1.0
Summary: Client SDK for the z-parser document extraction service — bytes in, RAG-ready Markdown out (PDF/OCR, Office, images, manuscripts, audio/video, EPUB, e-mail).
Project-URL: Documentation, https://github.com/novagen/z-parser
Author-email: Novagen <yarab@novagen.tech>
License: MIT
Keywords: document,extraction,markdown,ocr,parser,pdf,rag
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: General
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# z-parser

Python SDK for the **z-parser** document-extraction service: bytes in, RAG-ready
Markdown out. Scanned PDFs (SOTA OCR + vision escalation), Office, spreadsheets,
images, charts, manuscripts, EPUB, e-mail, audio/video transcription — one client.

```bash
pip install z-parser-sdk       # the import stays `z_parser`, the CLI stays `z-parser`
```

```python
from z_parser import ZParser

zp = ZParser("http://localhost:4056")     # or export Z_PARSER_URL
doc = zp.parse("rapport.pdf")             # path, or bytes + filename=
print(doc.parser, doc.num_chars)          # e.g. "mistral-ocr+figures(2)" 48213
doc.save("rapport.md")

pdf = zp.render_pdf("deck.pptx")          # Office → viewable PDF (page N = slide N)
figs = zp.images("catalogue.pdf", mode="artwork")   # per-figure crops + captions
```

CLI:

```bash
z-parser contract.pdf -o contract.md
```

**Pick your provider from the client** — Mistral, Ollama (100 % local), vLLM,
Hugging Face or any OpenAI-compatible vision endpoint, per client or per call:

```python
zp = ZParser(vision_provider="openai",
             vision_base_url="http://host.docker.internal:11434/v1",  # Ollama, seen FROM the server
             vision_model="llama3.2-vision",
             doc_vision=True)      # PDFs through local vision too → fully offline
```

One runnable example per provider ships in `examples/` (with sample files).
Safety contract: a caller-chosen `vision_base_url` never receives the server's
own API keys. With no provider params, the server's configuration applies.

Errors are explicit: `ZParserError` carries the service's `status`
(`unsupported` / `error`) and message. Timeouts default to 15 minutes — large
OCR jobs are slow by nature; pass `timeout=` to change.

The service itself (Docker, one container) and its ground-truth benchmark live in
the main repository.
