Skip to content

devanjedi/python-espncricinfo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-espncricinfo

A Python client for ESPNCricInfo's match and summary JSON.

Description

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.

Installation

pip install python-espncricinfo

Usage

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'

Tests

To run the tests:

python tests.py

Requires

  • requests

About

Python wrapper for the ESPNCricInfo JSON API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%