Skip to main content

Module python

Module python 

Source
Expand description

PyO3 bindings — the shadow._core Python extension module.

Exposed surface:

  • parse_agentlog(bytes) -> list[dict]
  • write_agentlog(list[dict]) -> bytes
  • canonical_bytes(payload_dict) -> bytes (SPEC §5)
  • content_id(payload_dict) -> str (SPEC §6)
  • compute_diff_report(baseline, candidate, pricing, seed) -> dict

Everything is dict-oriented on the Python side; pythonize handles the serde_json::Value ↔ PyObject conversion. Type hints for Python callers live in python/src/shadow/_core.pyi.