Skip to content
pranith7Public

About

Python Library for Cricbuzz..

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Cricinfo

A small Python interface for live cricket scores, commentary, match summaries, and scorecards from Cricbuzz.

CI Security

pip install cricinfo

Quick Start

from cricinfo import Cricbuzz

cricket = Cricbuzz()

matches = cricket.matches()
first_match = matches[0]

print(first_match["name"], first_match["id"])
print(cricket.result(first_match["id"]))

Every method returns regular Python data, so it is easy to use in scripts, notebooks, APIs, and dashboards.

Examples

List Matches

from cricinfo import Cricbuzz

cricket = Cricbuzz()

for match in cricket.matches():
    print(match["id"], match["name"])

Returned shape:

[
    {
        "id": "12345",
        "name": "India vs Australia 3rd ODI",
        "url": "https://m.cricbuzz.com/cricket-commentary/12345/...",
    }
]

Match Result

result = cricket.result("12345")

print(result["result"])
print(result["score"])

Live Score

live = cricket.livescore("12345")

print(live["status"])
print(live["team_scores"])
print(live["current_run_rate"])
print(live["batting"])
print(live["bowling"])

Commentary

for item in cricket.commentary("12345"):
    print(item)

Scorecard

scorecard = cricket.scorecard("12345")

for innings in scorecard["innings"]:
    print(innings["teams"])
    print(innings["tables"])

Human-Readable Printing

If you want the older console-style output, pass print_output=True.

cricket.matches(print_output=True)
cricket.livescore("12345", print_output=True)
cricket.scorecard("12345", print_output=True)

API

cricket = Cricbuzz(timeout=10)

Available methods:

Method Returns
matches() List of match dictionaries with id, name, and url
matchinfo(match_id) Match metadata dictionary
summary(match_id) List of summary strings
result(match_id) Dictionary with result and score
livescore(match_id) Dictionary with status, scores, batting, bowling, and partnership data
commentary(match_id) List of commentary strings
scorecard(match_id) Dictionary containing innings, teams, and scorecard table rows

Network and parsing errors raise CricbuzzError.

from cricinfo import Cricbuzz, CricbuzzError

try:
    print(Cricbuzz().matches())
except CricbuzzError as exc:
    print(f"Could not fetch Cricbuzz data: {exc}")

Development

python -m pip install -e ".[dev]"
python -m ruff check .
python -m mypy cricinfo
python -m pytest

See CONTRIBUTING.md for the full contributor workflow and docs/api.md for API details.

Release history is tracked in CHANGELOG.md, and upcoming work is tracked in ROADMAP.md.

Notes

This package scrapes Cricbuzz's public mobile pages. Page structure changes on Cricbuzz can require selector updates.

About

Python Library for Cricbuzz..

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages