andrewRowlinson / mplsoccer

Football pitch plotting library for matplotlib
MIT License
391 stars 80 forks source link

AttributeError: module 'mplsoccer.statsbomb' has no attribute 'read_event' #76

Closed aegonwolf closed 1 year ago

aegonwolf commented 1 year ago

Hi, Some of my old code is not working anymore. From the changelog I found that this has now changed. I looked over the documentation, however I do just want to load in some local statsbomb files.

Is this still possible, or can I only work with the online API from now?

andrewRowlinson commented 1 year ago

Yes it's possible to do this with the Sblocal class where the files are the paths for the individual files:

from mplsoccer import Sblocal
parser = Sblocal(dataframe=True)
df_competition = parser.competition(competition_file)
df_match = parser.match(match_file)
df_lineup = parser.lineup(lineup_file)
df_events, df_related, df_freeze, df_tactics = parser.event(event_file)
df_frame, df_visible = parser.frame(360_file)
aegonwolf commented 1 year ago

Yes it's possible to do this with the Sblocal class where the files are the paths for the individual files:

from mplsoccer import Sblocal
parser = Sblocal(dataframe=True)
df_competition = parser.competition(competition_file)
df_match = parser.match(match_file)
df_lineup = parser.lineup(lineup_file)
df_events, df_related, df_freeze, df_tactics = parser.event(event_file)
df_frame, df_visible = parser.frame(360_file)

Thanks a lot!