Why v1.5.0?
This new release introduces three powerful functions that allow you to access team-level stats, player-specific performance data, and detailed squad information.
team_stats_data
player_stats_data
squad_data
These additions make it easier than ever to conduct comprehensive analyses on team performances, individual player stats, and roster structures.
Follow the steps below to upgrade to the latest version.
If the datafc
package is already installed, you can update to the latest version by running the following command in the terminal:
--upgrade datafc pip install
If you haven’t installed datafc
before, use the following command:
pip install datafc
For more details about the package, you can visit its PyPI or GitHub pages.
New Features
team_stats_data
Fetches team-level statistics such as shots, passes, corners, fouls, and more.
player_stats_data
Retrieves detailed statistics of top-performing players (goals, assists, pass accuracy, etc.) across different categories for each team.
squad_data
Returns full squad information for each team, including player age, height, nationality, position, market value, and more.
Practical Example
Let’s take a look at team and player statistics, along with squad information, for the 2024/25 Premier League season.
from datafc.sofascore import (
standings_data,
team_stats_data,
player_stats_data,
squad_data
)
=17
tournament_id=61627
season_id
= standings_data(
standings_df =tournament_id,
tournament_id=season_id
season_id
)
= team_stats_data(
team_stats_df =standings_df,
standings_df=tournament_id,
tournament_id=season_id
season_id
)
= player_stats_data(
player_stats_df =standings_df,
standings_df=tournament_id,
tournament_id=season_id
season_id
)
= squad_data(
squad_df =standings_df
standings_df )
Best regards.