Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyplaycricket

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyplaycricket

Iteracting with the playcricket API for statistical analysis and automated social media posts.

  • 1.3.2
  • PyPI
  • Socket score

Maintainers
1

pyplaycricket

pyplaycricket is a package for extracting data programmatically from your playcricket site.


Installation

[fix link] Use the package manager pip to install pyplaycricket.

pip install pyplaycricket

Or install via Anaconda.

conda install -c conda-forge pyplaycricket

Access Requirements

To use the PlayCricket APIs you need to:

  1. Email play.cricket@ecb.co.uk to request access.
  2. You will need to be a PlayCricket admin for your club's site.
  3. You will need to share a fair usage agreement on behalf of your club.

They will confirm your site id and your API key.


Library Structure

The library is split into 4 main modules. 3 are generic playcricket modules which can be used for interrogating playcricket data. The Alleyn module has been created for club specific requests.

  • playcricket: generic methods for retrieving different data from playcricket sites.
  • utils: internal methods called repeatedly by other modules.
  • alleyn: specific methods for Alleyn CC analysis and social media posts.
  • config: where URLs, team IDs and more are stored for use in playcricket, utils and alleyn.

Quick start

Retrieve all playcricket matches in a given season for your club.

from playcric.playcricket import pc
site_id = 'insert_your_site_id_here'
api_key = 'insert_your_api_key_here'

playc = pc(api_key=api_key, site_id=site_id)
matches = playc.get_all_matches(season=2024)
idstatuspublishedlast_updatedleague_nameleague_idcompetition_namecompetition_idcompetition_typematch_typegame_typeseasonmatch_datematch_timeground_nameground_idground_latitudeground_longitudehome_club_namehome_team_namehome_team_idhome_club_idaway_club_nameaway_team_nameaway_team_idaway_club_idumpire_1_nameumpire_1_idumpire_2_nameumpire_2_idumpire_3_nameumpire_3_idreferee_namereferee_idscorer_1_namescorer_1_idscorer_2_namescorer_2_id
06571330NewYes2024-04-19 00:00:00FriendlyLimited OversStandard20242024-04-27 00:00:0010:00Edward Alleyn Club935251.4491-0.0915547Alleyn CCFriendly XI320697672Alleyn CCBurbage Badgers268144672
16242035NewYes2024-07-31 00:00:00Surrey Junior Cricket Championship10881U11 Surrey County Cup63219CupLimited OversStandard20242024-05-05 00:00:0009:00Battersea Park5663951.4802-0.155702Spencer CC, SurreyBU11 Tier1A2564175853Alleyn CCUnder 1190654672
26242558NewYes2024-07-31 00:00:00Surrey Junior Cricket Championship10881U14 Surrey County Cup63217CupLimited OversStandard20242024-05-05 00:00:0009:30Morden Park Main Pitch5715951.3888-0.210369AJ Cricket AcademyUnder 1425793414870Alleyn CCUnder 1459853672

Retrieve a league table

from playcric.playcricket import pc
site_id = 'insert_your_site_id_here'
api_key = 'insert_your_api_key_here'

playc = pc(api_key=api_key, site_id=site_id)
league_table, key = playc.get_league_table(117611, simple=True, clean_names=False)
POSITIONTEAMWDLPTS
01Horley CC, Surrey821219
12Alleyn CC822198
23Egham CC614170
34Cobham Avorians CC615166
45Byfleet CC606158
56Kingstonian CC, Surrey616149
67Thames Ditton CC514147
78Effingham CC425118
89Old Pauline CC408111
910Churt and Hindhead CC201079

What are the different IDs used in the different functions?

Most of the IDs required for filtering on leagues, competitions, teams, clubs etc can be gleaned from the get_all_matches function. By default, this will return the matches associated with your site.

If you want to return all the fixtures for another club, you will need to find this on their playcricket site, at the bottom of the home page.

What is pyplaycricket?

In pyplaycricket, you can:

  • list all registered players for a club
  • get all matches for a club
  • get a league table in dataframe form
  • get all players involved in a fixture
  • get all partnerships from a fixture
  • get all individual stats from a fixture
  • get all individual stats totalled over a season

I hope pyplaycricket makes it easier to return data from playcricket for a variety of different use cases.

License

MIT

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc