MCPcopy
hub / github.com/vinta/awesome-python / load_stars

Function load_stars

website/build.py:89–96  ·  view source on GitHub ↗

Load star data from JSON. Returns empty dict if file doesn't exist or is corrupt.

(path: Path)

Source from the content-addressed store, hash-verified

87
88
89def load_stars(path: Path) -> dict[str, dict]:
90 """Load star data from JSON. Returns empty dict if file doesn't exist or is corrupt."""
91 if path.exists():
92 try:
93 return json.loads(path.read_text(encoding="utf-8"))
94 except json.JSONDecodeError:
95 return {}
96 return {}
97
98
99def sort_entries(entries: Sequence[TemplateEntry]) -> list[TemplateEntry]:

Callers 5

mainFunction · 0.90
test_loads_valid_jsonMethod · 0.90
buildFunction · 0.85

Calls

no outgoing calls