Spaces:
Sleeping
Sleeping
Download game/catalog.py from byte-vortex/Myco: direct link, hf CLI and curl.
- Browser
- Download file 486 Bytes
-
https://huggingface.co/spaces/byte-vortex/Myco/resolve/5b6725d501a8e358094de1531e00a92e938dcfc9/game/catalog.py
- Command line
-
hf download hf://spaces/byte-vortex/Myco@5b6725d501a8e358094de1531e00a92e938dcfc9/game/catalog.py
-
curl -L -o catalog.py https://huggingface.co/spaces/byte-vortex/Myco/resolve/5b6725d501a8e358094de1531e00a92e938dcfc9/game/catalog.py
486 Bytes
| """Mushroom catalog loading for Myco.""" | |
| import json | |
| from functools import lru_cache | |
| from pathlib import Path | |
| from models.mushroom import Mushroom | |
| CATALOG_PATH = Path(__file__).resolve().parents[1] / "data" / "mushrooms.json" | |
| def load_mushrooms() -> tuple[Mushroom, ...]: | |
| """Load the in-repo mushroom catalog.""" | |
| raw_mushrooms = json.loads(CATALOG_PATH.read_text(encoding="utf-8")) | |
| return tuple(Mushroom.from_dict(item) for item in raw_mushrooms) | |