Skip to main content

cricheroes

Python APIs to fetch and store data of a particular team from cricheroes.in

Set up

Install Google Chrome

Install python module

  • Download and install 'cricheroes' python module from pypi.
  • Use the following command
pip install cricheroes

Usage

  • Create Team object and use it as per your requirement
from cricheroes import Team
# Create Team Object 
team = Team(url='2580003/CP-Sm@shers')

# Get all players, returns list of Player object in cricheroes module
players = team.get_players()

# Print player names
for player in players:
    print(player.name)
    
# Get recent matches played by the team, returns list of Match object
matches = team.get_matches()
# Print match results
for match in matches:
    print(match.result)

# Get over all team statistics from Stats tab
stats = team.get_team_stats()
# Print match results
for stat in stats:
    print(stat.label)
    print(stat.value)
    
# Get leaderboard/top performer of the team, returns dictionary with batting, bowling, fielding statistics
# Each value contains list of LeaderboardStat
leaderboard = team.get_leaderboard()
# Print batting stat
for item in leaderboard['batting']:
    print(item.player_name, item.stat)

# Print batting stat
for item in leaderboard['bowling']:
    print(item.player_name, item.stat)

# Print fielding stat
for item in leaderboard['fielding']:
    print(item.player_name, item.stat)

# Get all data and dump to json
from cricheroes import Team
# Create Team Object 
team = Team(url='2580003/CP-Sm@shers')
team.dump_all()

# This will craete a json file 'out.json' at current directory

To test:

  • Download gist file from here
  • Run file after doing the set up
python cricheroes_test.py
  • out.json file will be created at current directory

Release files for cricheroes 1.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for cricheroes 1.0.10
File Interpreter ABI Platform
cricheroes-1.0.10-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / cricheroes-1.0.10-py2.py3-none-any.whl

Download URL cricheroes-1.0.10-py2.py3-none-any.whl
Size 6.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0d87f9d193bdfcad292d2bf4b4340acb72513f118b6eaf0b22f5483f9ef1cdba
BLAKE2b-256 checksum
How to use checksums
34af57cc1fecf11ee7384e84f4fcd3112162496138dbe9e555ac21a90f99e481
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.0.10 This release

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page