dnd_5etools_utils/dnd5etools/scripts/spell_templates.py
David Kruger 4ee91edc61 Start of 5etools utilities and library
Copying over the bestiary from dnd_monster_stats and working on a
similar SpellList object and Spell DB.
2025-05-20 20:33:55 -07:00

18 lines
503 B
Python

import pprint
import dnd5etools.db.spells
import dnd5etools.scripts.argparse
def main():
args = dnd5etools.scripts.argparse.build_argument_parser(
"Summarizes spell templates",
).parse_args()
db = dnd5etools.db.spells.SpellsDb(args.data_dir)
if args.source_code is None:
codes = list(db.db_index.source_index.keys())
else:
codes = args.source_code
for code in codes:
spell_list = db.get_spell_list(code)
pprint.pprint(spell_list.spells)