9 lines
413 B
Python
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]
|