Metadata-Version: 2.5
Name: pandoc-wheel
Version: 3.13.0
Summary: Pandoc binaries distributed as Python wheels
Project-URL: Repository, https://github.com/nbprint/pandoc-wheel
Project-URL: Homepage, https://github.com/nbprint/pandoc-wheel
Author-email: the pandoc-wheel authors <3105306+timkpaine@users.noreply.github.com>
License: Apache-2.0 AND GPL-2.0-or-later AND MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.11
Provides-Extra: develop
Requires-Dist: build; extra == 'develop'
Requires-Dist: bump-my-version; extra == 'develop'
Requires-Dist: check-dist; extra == 'develop'
Requires-Dist: cibuildwheel; extra == 'develop'
Requires-Dist: codespell; extra == 'develop'
Requires-Dist: hatchling; extra == 'develop'
Requires-Dist: mdformat; extra == 'develop'
Requires-Dist: mdformat-myst; extra == 'develop'
Requires-Dist: mdformat-tables>=1; extra == 'develop'
Requires-Dist: pypandoc; extra == 'develop'
Requires-Dist: pytest; extra == 'develop'
Requires-Dist: pytest-cov; extra == 'develop'
Requires-Dist: ruff; extra == 'develop'
Requires-Dist: twine; extra == 'develop'
Requires-Dist: ty; extra == 'develop'
Requires-Dist: uv; extra == 'develop'
Requires-Dist: wheel; extra == 'develop'
Description-Content-Type: text/markdown

# pandoc-wheel

[Pandoc 3.13](https://github.com/jgm/pandoc/releases/tag/3.13) binaries distributed as Python wheels.

[![Build Status](https://github.com/nbprint/pandoc-wheel/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/nbprint/pandoc-wheel/actions/workflows/build.yaml)
[![License](https://img.shields.io/github/license/nbprint/pandoc-wheel)](https://github.com/nbprint/pandoc-wheel)

## Run Pandoc

Download the matching wheel from the [build artifacts](https://github.com/nbprint/pandoc-wheel/actions/workflows/build.yaml), extract the artifact, and install it:

```bash
python -m pip install ./pandoc_wheel-*.whl
pandoc --version
pandoc input.md -o output.docx
```

Native wheels install the upstream executable directly into the environment's scripts directory (`bin` or `Scripts`). Supported platforms: macOS 15+ arm64, glibc Linux x86_64 and aarch64 (manylinux2014), and Windows x64. Wheels require Python 3.11+.

For a Python API, install [pandoc](https://pypi.org/project/pandoc/) or [pypandoc](https://pypi.org/project/pypandoc/) separately. For example:

```bash
python -m pip install pypandoc
```

```python
import pypandoc

html = pypandoc.convert_text("**Hello**", "html", format="markdown")
```

The binary distribution has no runtime dependencies. Applications can depend on both it and their chosen Python wrapper.

## Load Pandoc in Pyodide

The `pyemscripten_2026_0_wasm32` wheel contains `pandoc.wasm`, the upstream JavaScript interface bundled as `pandoc.mjs`, and its WASI shim. Install it in Pyodide 314.0.7, then load those assets from JavaScript using an initialized `pyodide` instance:

```javascript
await pyodide.loadPackage("micropip");
await pyodide.runPythonAsync(`
import micropip
await micropip.install("https://your-host/pandoc_wheel-3.13.0-py3-none-pyemscripten_2026_0_wasm32.whl")
`);
const payload = pyodide.runPython(`
from importlib.resources import files
str(files("pandoc_wheel") / "bin")
`);
const source = pyodide.FS.readFile(`${payload}/pandoc.mjs`, {encoding: "utf8"});
const {createPandoc} = await import(`data:text/javascript;charset=utf-8,${encodeURIComponent(source)}`);
const pandoc = await createPandoc(pyodide.FS.readFile(`${payload}/pandoc.wasm`));
const result = await pandoc.convert({from: "markdown", to: "html"}, "**Hello**", {});
console.log(result.stdout);
```

Use [Pandoc's WASM interface](https://github.com/jgm/pandoc/blob/3.13/wasm/pandoc.js) for options, queries, and binary files. Conversion uses the bundled assets without further downloads. Native Python wrappers use subprocesses and cannot execute this WASI module in Pyodide. The WASM sandbox cannot run external filters or PDF engines.

## Build wheels

```bash
uv venv --python 3.11
source .venv/bin/activate
make develop
make lint checks coverage build
```

Native builds download checksum-pinned upstream binaries. To build the Pyodide wheel, install Node.js and npm, then run:

```bash
PANDOC_WHEEL_PLATFORM=pyemscripten_2026_0_wasm32 python -m build -w
cd js
npm install --no-save --package-lock=false pyodide@314.0.7 playwright@1.64.1
npx playwright install chromium
PANDOC_TEST_BROWSER=1 node test-pyodide.mjs ../dist/*pyemscripten*.whl
```

CI builds and tests all five platforms. Native tests verify the installed executable and pypandoc compatibility. Pyodide tests install the wheel and exercise the upstream WASM interface in Node.js and Chromium. The bundled Pandoc version is pinned in `hatch_build.py`.

## License

Packaging code uses Apache-2.0; see [LICENSE](LICENSE). Bundled Pandoc uses GPL-2.0-or-later; its [source](https://github.com/jgm/pandoc/tree/3.13), [build instructions](https://github.com/jgm/pandoc/blob/3.13/INSTALL.md), copyright notice, and license are available upstream. Wheels include Pandoc's `COPYING.md` and `COPYRIGHT`. The WASM interface and WASI shim use MIT licenses, also included in the Pyodide wheel.

> [!NOTE]
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
