Metadata-Version: 2.4
Name: glitchmuseum
Version: 0.3.0
Summary: Python interface to the GlitchMuseum evaluator
License-Expression: Apache-2.0
Project-URL: Homepage, https://glitchmuseum.eu/
Project-URL: Repository, https://github.com/fulminegit/glitchmuseum
Project-URL: Issues, https://github.com/fulminegit/glitchmuseum/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Dynamic: license-file

# GlitchMuseum Python SDK

The Python SDK runs the shared evaluator through the GlitchMuseum Node CLI.
Use Python 3.10 or later and Node 24 or 26. Install the wheel from the
[GitHub release](https://github.com/fulminegit/glitchmuseum/releases/tag/v0.3.0)
and install the CLI in your project.

```sh
python -m pip install ./glitchmuseum-0.3.0-py3-none-any.whl
npm install --save-exact glitchmuseum@0.3.0
```

Pass parsed JSON objects to `engine.validate`, `engine.verify` or
`engine.compare`. The returned dictionaries use the same report fields
as Node. Set the CLI path to a trusted installed entry point. Evidence
goes to the local child process over stdin. The SDK needs no external model
or account.

## CI conformance

The Python SDK uses the Node CLI's `bridge` command. When using pytest,
provide the CLI location explicitly and assert the structured result.

```python
import json
from pathlib import Path

from glitchmuseum import GlitchMuseum


def test_recorded_run_has_required_evidence():
    engine = GlitchMuseum(Path("node_modules/glitchmuseum/dist/index.js"))
    bundle = json.loads(Path("test/bundle.json").read_text(encoding="utf-8"))
    observed = json.loads(Path("test/observed.json").read_text(encoding="utf-8"))
    report = engine.verify(bundle, observed)
    assert report["status"] == "pass", report["counts"]
```

Generate your observed fixture with trusted hooks. The [FastMCP example](../../examples/mcp/)
shows a local MCP tool error and the recorded handoff evidence the evaluator
expects. Run the SDK's conformance test with `python -m unittest discover -s sdk/python/tests`
after installing the SDK locally.
