Seeded repo
This commit is contained in:
parent
451fb5924c
commit
762707cefe
34 changed files with 1526 additions and 1 deletions
9
connectors/json_fixture.py
Normal file
9
connectors/json_fixture.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"""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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue