content-explorer/connectors/json_fixture.py
2026-10-12 18:28:16 +02:00

9 lines
413 B
Python

"""Illustrative JSON fixture reader. Production connector protocol is described in architecture/ConnectorContract.md."""
import json
from pathlib import Path
def load_snapshot(path: str | Path) -> dict:
return json.loads(Path(path).read_text(encoding="utf-8"))
def entities_by_kind(snapshot: dict, kind: str) -> list[dict]:
return [entity for entity in snapshot["entities"] if entity["kindId"] == kind]