NEW FILE: cleanyaml.py which sorts and cleans all the various yaml files

bradl/monsters-adult-gold-dragon
James R Miller 2020-02-20 17:34:16 -06:00
parent 09b745d3c8
commit 16885ca59d
2 changed files with 48 additions and 15 deletions

View File

@ -75,36 +75,35 @@ lang_rarity:
- Secret
movement:
- Air Walk (constant)
- Land
- Burrow
- Burrow (sand only)
- Burrow (snow only)
- Can't Move
- Climb
- Climb Stone
- Ice Climb
- Ice Stride
- Trickster's Step
- Earth Glide
- Sand Glide
- Glide
- Cloud Walk
- Compression
- Suction
- Freedom of Movement (constant)
- Spider Climb (constant)
- Unstoppable Burrow
- Earth Glide
- Fly
- Fly (from fly)
- Freedom of Movement (constant)
- Glide
- Ice Climb
- Ice Stride
- Land
- Magma Swim
- Powerful Jumper
- Sand Glide
- Spider Climb (constant)
- Suction
- Swim
- Swamp Stride
- Swiftness
- Woodland Stride
- Trickster's Step
- Trackless Step
- Cloud Walk
- Powerful Jumper
- Swiftness
- Unstoppable Burrow
- Walk in Shadow
- Woodland Stride
size:
- name: Tiny
space_in_ft: 4

View File

@ -0,0 +1,34 @@
# THIS FILE SIMPLY LOADS THE YAML FILE INTO PYYAML AND THEN SPITS IT BACK OUT
# TO CLEAN UP AND ORDER ALL THE YAML
import yaml
yfiles = ["actions.yaml",
"backgrounds.yaml",
"basics.yaml",
"bulks.yaml",
"conditions.yaml",
"damages.yaml",
"feats-levels-false-matches.yaml",
"feats.yaml",
"langs.yaml",
"monsters.yaml",
"requirements.yaml",
"skills.yaml",
"sources.yaml",
"spells.yaml",
"traits.yaml",
"triggers.yaml"]
def main():
for x in yfiles:
with open(x, 'r') as r:
data = yaml.full_load(r)
final = yaml.safe_dump(data, allow_unicode=True)
with open(x, 'w') as f:
f.write(final)
if __name__ == "__main__":
main()