Skip to content

Instantly share code, notes, and snippets.

@ZachOrr
Created March 15, 2019 01:06
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 ZachOrr/6d710eb532ff525b0ed2ca7d9011929b to your computer and use it in GitHub Desktop.
Save ZachOrr/6d710eb532ff525b0ed2ca7d9011929b to your computer and use it in GitHub Desktop.
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