A Python client for ESPNCricInfo's match and summary JSON.
The splendid espncricinfo.com site not only provides individual HTML pages of cricket matches, it also provides a JSON representation of data from each match. This Python library provides access to many of those JSON attributes as well as some helper functions. All you need is the match ID, which is the number at the end of a match page URL. See the Usage section for instructions, and see match.py
for individual functions.
Disclaimer: This library is not intended for commercial use and neither it nor its creator has any affiliation with ESPNCricInfo. The LICENSE for this library applies only to the code, not to the data.
pip install python-espncricinfo
For a summary of live matches, create an instance of the Summary
class:
>>> from espncricinfo.summary import Summary
>>> s = Summary()
>>> s.match_ids
[u'68079', u'68209', u'68081', u'61375', u'65429']
For individual matches, pass in the numeric ID as an integer or a string:
>>> from espncricinfo.match import Match
>>> m = Match(64148)
>>> m.description()
u'England [Marylebone Cricket Club] tour of Australia, Only ODI: Australia v England at Melbourne, Jan 5, 1971'
To run the tests:
python tests.py
- requests