Created
March 15, 2019 01:06
-
-
Save ZachOrr/6d710eb532ff525b0ed2ca7d9011929b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def match_sort_key(match): | |
COMP_LEVELS_PLAY_ORDER = { | |
'qm': 1, | |
'ef': 2, | |
'qf': 3, | |
'sf': 4, | |
'f': 5, | |
} | |
return "{}_{}".format(COMP_LEVELS_PLAY_ORDER[match['comp_level']], str(match['match_number']).zfill(3)) | |
print([x['key'] for x in sorted(tba.event_matches('2019mike2'), key=match_sort_key)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment