Skip to content

trmittal24/python-espncricinfo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 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 ID as 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'

A full list of methods available to an instance of the Match class is in the code.

For player details, pass in the player ID (found in a player's URL - for example, Ajinkya Rahane is '277916'):

>>> from espncricinfo.player import Player
>>> p = Player('277916')
>>> p.name
u'Ajinkya Rahane'

A full list of methods available to an instance of the Player class is in the code.

Tests

To run the tests:

python tests.py

Requires

See requirements.txt

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%