Metadata-Version: 2.4
Name: wasmsh-pyodide-runtime
Version: 0.6.3
Summary: Pyodide-backed wasmsh runtime assets for Python integrations
License: Apache-2.0
Classifier: License :: OSI Approved :: Apache Software License
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
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# wasmsh-pyodide-runtime

Packaged Pyodide-backed wasmsh runtime assets for Python integrations.

This package bundles the custom Pyodide distribution and Node host script
produced by the [wasmsh](https://github.com/mayflower/wasmsh) build, and
exposes stable helpers to locate them at runtime. It is the Python-side
companion to the `wasmsh-pyodide` npm package.

## Install

```bash
pip install wasmsh-pyodide-runtime
```

## Usage

```python
from wasmsh_pyodide_runtime import get_dist_dir, get_asset_path, get_node_host_script

# Path to the packaged Pyodide distribution directory
dist = get_dist_dir()

# Path to a specific asset (e.g., the WASM binary)
wasm = get_asset_path("pyodide.asm.wasm")

# Path to the Node host script (used by langchain-wasmsh)
host = get_node_host_script()
```

## Reference

### `get_dist_dir() -> Path`

Returns the directory containing the packaged Pyodide assets (`pyodide.asm.js`,
`pyodide.asm.wasm`, `python_stdlib.zip`, etc.).

### `get_asset_path(name: str) -> Path`

Returns the path to a specific asset file within the distribution directory.

### `get_node_host_script() -> Path`

Returns the path to the packaged `node-host.mjs` script. This is the
entrypoint that `langchain-wasmsh` launches as a Deno or Node.js subprocess
to host the Pyodide/Emscripten runtime.

## Explanation

This package exists so that Python consumers (like `langchain-wasmsh`) can
depend on a single PyPI package to get the wasmsh runtime assets, without
needing to install npm or run a build. The assets are identical to those in
the `wasmsh-pyodide` npm package — the `tools/pyodide/package-runtime-assets.mjs`
script copies them into both package layouts from the same build output.
