Created
September 1, 2020 07:47
-
-
Save charlesreid1/5b6e28f46fc371fd2362ca9c629e341e to your computer and use it in GitHub Desktop.
Blaseball team division and league information in JSON format
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
{ | |
"Lawful Good": [ | |
"Lovers", | |
"Tacos", | |
"Steaks", | |
"Breath Mints", | |
"Firefighters" | |
], | |
"Chaotic Good": [ | |
"Shoe Thieves", | |
"Flowers", | |
"Fridays", | |
"Magic", | |
"Millennials" | |
], | |
"Lawful Evil": [ | |
"Crabs", | |
"Pies", | |
"Sunbeams", | |
"Wild Wings", | |
"Tigers" | |
], | |
"Chaotic Evil": [ | |
"Moist Talkers", | |
"Spies", | |
"Dal\u00e9", | |
"Garages", | |
"Jazz Hands" | |
] | |
} |
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
{ | |
"The Good League": [ | |
"Lovers", | |
"Tacos", | |
"Steaks", | |
"Breath Mints", | |
"Firefighters", | |
"Shoe Thieves", | |
"Flowers", | |
"Fridays", | |
"Magic", | |
"Millennials" | |
], | |
"The Evil League": [ | |
"Crabs", | |
"Pies", | |
"Sunbeams", | |
"Wild Wings", | |
"Tigers", | |
"Moist Talkers", | |
"Spies", | |
"Dal\u00e9", | |
"Garages", | |
"Jazz Hands" | |
] | |
} |
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
import json | |
from blaseball_mike.models import Division | |
from blaseball_mike.models import League | |
from pprint import pprint | |
divisions = {} | |
# list of (4) divisions | |
divs = list(Division.load_all().values()) | |
for div in divs: | |
division_name = div.name | |
divisions[division_name] = [] | |
teams = list(div.teams.values()) | |
for team in teams: | |
team_nickname = team.nickname | |
divisions[division_name] += [team_nickname] | |
print("-"*40) | |
print(json.dumps(divisions, indent=4)) | |
with open('blaseball_divisions.json', 'w') as f: | |
f.write(json.dumps(divisions, indent=4)) | |
subleagues = {} | |
# list of (2) leagues | |
subs = list(League.load().json()['subleagues'].values()) | |
for sub in subs: | |
name = sub.name | |
subleagues[name] = [] | |
divs = list(sub.divisions.values()) | |
for div in divs: | |
subleagues[name] += divisions[div.name] | |
print("-"*40) | |
print(json.dumps(subleagues, indent=4)) | |
with open('blaseball_leagues.json', 'w') as f: | |
f.write(json.dumps(subleagues, indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment