soccer-cli
soccer-cli copied to clipboard
Convert leagues to JSON, add league lookup
Continuing from #83, replace the league*.py files with leagues.json, which is similar in structure to teams.json.
...
"properties":{
"cl":[
1,
3
],
"el":[
4,
4
],
"rl":[
19,
20
]
},
"name":"Ligue 1",
"code":"FL",
"id":396
},
{
"properties":{
"cl":[
1,
2
],
"el":[
3,
6
],
"rl":[
21,
24
]
},
"name":"League One",
"code":"EL1",
"id":425
},
...
Rewrite main.py and writers.py to accomodate.
As well, add league codes to the --list arg, like so:

Lastly, extend --lookup arg to work for leagues as well, in the spirit of #85.
$ soccer --league BL2 --lookup
2. Bundesliga
Okay, found some bugs with the initial commit. Had to move JSON loading into jsonhandler.py, then have main.py and writers.py work from there. Otherwise we'd get cyclical imports and other bad stuff.
As a result, this works not just with python main.py, but also regular old soccer.