2025-07-28 15:29:17 +02:00

21 lines
645 B
Python
Executable File

#!/home/fname/Projects/OpenSource/python-mommy-venv/.venv/bin/python3
import requests
from pathlib import Path
import json
CARGO_MOMMY_DATA = "https://raw.githubusercontent.com/diamondburned/go-mommy/refs/heads/main/responses.json"
MODULE_PATH = Path("python_mommy_venv")
if __name__ == "__main__":
print("generating stuff")
res = requests.get(CARGO_MOMMY_DATA)
if not res.ok:
raise Exception(f"couldn't fetch {CARGO_MOMMY_DATA} ({res.status_code})")
print(f"writing {Path(MODULE_PATH, 'responses.json')}")
with Path(MODULE_PATH, "responses.json").open("w") as f:
json.dump(res.json(), f, indent=4)