Skip to content

Instantly share code, notes, and snippets.

@ZephyrBlu
Created January 13, 2021 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZephyrBlu/f24ea40eb38127640194691959f957f6 to your computer and use it in GitHub Desktop.
Save ZephyrBlu/f24ea40eb38127640194691959f957f6 to your computer and use it in GitHub Desktop.
Simple script for analyzing your replays
from pathlib import Path
from zephyrus_sc2_parser import parse_replay
# change this to match the directory you're using
replays = Path('replays')
def recurse(dir_path):
"""
Recursively searches directories to parse replay files
"""
for obj_path in dir_path.iterdir():
if obj_path.is_file():
replay = parse_replay(obj_path)
# do stuff with the data
elif obj_path.is_dir():
recurse(obj_path)
recurse(replays)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment