# brewdoc

> Fast, deterministic document-to-Markdown conversion for agent systems. Easy to install. No model weights, OCR or external services.

Local conversion after installation is offline and downloads no runtime components.
Supported formats and readable-file constraints are defined in FORMATS.md.

- [Installation](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/INSTALL.md): pip, uv/uvx, pipx, native downloads, PATH, update and removal.
- [CLI/API and receipts](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/README.md): deterministic Markdown and machine-readable results.
- [Format limits](https://github.com/kochetkov-ma/brewdoc/blob/v0.3.2/FORMATS.md): supported/refused inputs, omissions and resource budgets.
- [Latest release](https://github.com/kochetkov-ma/brewdoc/releases/latest): concise features, actual assets and channel availability.
- Examples select 0.3.2; use a channel listed as available in [that release](https://github.com/kochetkov-ma/brewdoc/releases/tag/v0.3.2). npm targets Linux x64/glibc and macOS ARM64; Windows uses GitHub native or Python.

## CLI and API

```sh
brewdoc file.pdf --out file.md
brewdoc book.xlsx --sheet Calc --sheet Inputs --out book.md
brewdoc --self-check
```

Conversion prints a JSON receipt first; without --out, Markdown follows on stdout.
Paths resolve against the caller's directory; --out creates parents. --sheet and
--artifact are repeatable and workbook-only. Markdown is brewdoc.markdown/2;
local receipts are brewdoc.receipt/1, URL receipts brewdoc.receipt/2.
Exit 0 means conversion, 1 refusal and 2 invalid usage. Success does not prove fidelity.

```python
import brewdoc
code, receipt, markdown = brewdoc.run("book.epub", out="book.md")
markdown, tally = brewdoc.render_html("page.html")
```

Local run/render APIs and self-check never acquire URLs.

## Deliberate HTTP acquisition

```sh
brewdoc --url https://example.com --render-js --timeout 30 --out page.md
```

--url deliberately fetches a public HTTP(S) page. DNS, destinations, redirects,
TLS, requests and byte budgets are validated. The default waiting budget is 30
seconds. JS uses installed/bundled components and may preserve valid partial
content on timing-only expiry; hard failures refuse. Ordinary requests use GET;
only the narrow credential-free HN Algolia XHR POST exception is admitted.
See the format limits for supported JS runtimes and prerequisite refusals.

This is a readable entry point, without a promise of automatic client discovery.
