outside-edge / python-espncricinfo

Python wrapper for the ESPNCricInfo JSON API
MIT License
144 stars 65 forks source link

Convert List of Dictionaries to a Single Dictionary #25

Closed Ehsan1997 closed 5 years ago

Ehsan1997 commented 5 years ago

While trying to access the batting_fielding_averages of a player we get a list of Dictionaries (With just one key, value pair) which is very annoying, because it forces you to do this: player.batting_fielding_averages[2]['T20Is] rather than player.batting_fielding_averages['T20Is]. I can fix this in places where I observe this, but until all such issue are solved this issue should remain open.

dwillis commented 5 years ago

Just pushed a fix for this that also changes the interior tuples into a dict, so you can now use syntax like this: p.batting_fielding_averages['Tests']['high_score']