Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generate_monsters_complete():
"""Generate the `docs/monsters-complete.json` file."""
# Read in the item database content
path_to_monsters_json = Path(config.DOCS_PATH / "monsters-json")
all_db_monsters = monsters_api.all_monsters.AllMonsters(path_to_monsters_json)
monsters = {}
for monster in all_db_monsters:
json_out = monster.construct_json()
monsters[monster.id] = json_out
# Save all monsters to docs/monsters-complete.json
out_fi = Path(config.DOCS_PATH / "monsters-complete.json")
with open(out_fi, "w") as f:
json.dump(monsters, f)
# Save all monsters to osrsbox/docs/monsters-complete.json
out_fi = Path(config.PACKAGE_PATH / "docs" / "monsters-complete.json")
with open(out_fi, "w") as f:
json.dump(monsters, f)