Package: rugbypy
rugbypyrugbypyis a Python package that aims to make rugby data more
available to aid in the development of rugby analytics. Currently we
only have 2023 data available with previous years coming soon!Requirementspython version 3.8InstallpipinstallrugbypyHow to useMatch StatsYou can fetch all the matches that occured on a particular date with:matches=fetch_matches(date="20230101")matchesFetching matches on date:20230101...match_idcompetition_idhome_team_idaway_team_iddate0595735267979259072590120230101Then using that match id you can feed it into the match details
function:match_details=fetch_match_details(match_id="595735")match_detailsFetching match details for match_id:595735...match_iddatecompetition_idcompetitionvenue_idvenuecity_playedhome_teamaway_teamhome_team_idaway_team_idcompletedis_tournamentplayed_on_grassattendancehome_team_formaway_team_form059573520230101267979Premiership Rugby26070cinch Stadium at Franklin's GardensNorthamptonNorthampton SaintsHarlequins2590725901TrueTrueTrueNoneLLWWLWLWLLTeam StatsYou can then fetch the team stats for a particular team on a particular
date with:team_stats=fetch_team_stats(team_id="25901",date="20230108")team_statsFetching team stats for team_id:25901 on date:20230108...teamgame_dateteam_idteam_vsteam_vs_idclean_breaksconversion_goalsdefenders_beatenkick_percent_successkicks...scrums_totalscrums_wontacklesterritorytotal_free_kicks_concededtotal_lineoutstriesturnover_knock_onturnovers_concededyellow_cards0Harlequins2023010825901Sale Sharks259083.00.024.00.50.0...7.05.0125.00.410.011.02.08.017.00.01 rows × 40 columnsPlayer StatsWe have the ability to fetch player stats for all the games they have
bene involved in. We firstly identify the `player_id`` of a player by
searching our player manifest file.player_manifest=fetch_all_players()player_manifest.head()player_idplayer_name0246815Will Edwards1158708Tommaso Allan2299436Oscar Beard3299031Fin Baxter4298485Jordan ElsOr we can search for a certain player through our similarity tool:individual_player=fetch_player(name="johnny sexton")individual_playerplayer_idplayer_name267149315Anthony Watson29416004Johnny Sexton796291349Ayden JohnstoneWe can also fetch the player stats for any player using theirplayer_ids. In this example we fetch Johnny Sextons player stats:player_stats=fetch_player_stats(player_id="16004")player_statsFetching all player stats for player_id:16004...player_idgame_datenameteamteam_idcompetition_idcompetitionteam_vsteam_vs_idweight...rucks_wonrunstacklestotal_free_kicks_concededtotal_lineoutstriestry_assiststurnover_knock_onturnovers_concededyellow_cards01600420230204Johnny SextonIreland3180659Six Nations Championship4Wales92.0...3.08.07.00.00.00.00.00.01.00.001600420230211Johnny SextonIreland3180659Six Nations Championship9France92.0...1.05.03.00.00.00.00.00.00.00.001600420230312Johnny SextonIreland3180659Six Nations Championship2Scotland92.0...2.05.09.00.00.00.00.00.02.00.001600420230318Johnny SextonIreland3180659Six Nations Championship1England92.0...6.09.05.00.00.00.00.01.02.00.001600420230909Johnny SextonIreland3164205Rugby World Cup12Romania92.0...0.05.04.00.00.02.00.00.00.00.001600420230916Johnny SextonIreland3164205Rugby World Cup16Tonga92.0...1.01.02.00.00.01.00.00.00.00.06 rows × 40 columns