Comments (1)
-
You have to store the WhoScored JSON files in a file structure that includes the competition ID, season ID and game ID. For example:
./data/2-2021/game_1234.json
,./data/2-2021/game_1235.json
, ... where 2 is the competition ID, 2021 is the season ID, and 1234 and 1235 are the game IDs. -
Create and
OptaLoader
instance
from socceraction.spadl.opta import OptaLoader
loader = OptaLoader(
root="./data",
parser='whoscored',
feeds={'whoscored': "{competition_id}-{season_id}/game_{game_id}.json"})
The feeds dict is a pattern that allows the loader to select the corresponding json files for a competition, season or game. It should correspond to the file structure above, where the IDs are replaced by the "{competition_id}", "{season-id}" and "{game_id}" keys.
- Load data with
games = games(competition_id=2, season_id=2021)
players = loader.players(game_id=1234)
teams = loader.teams(game_id=1234)
events = loader.events(game_id=1234)
Some notes:
- The WhoScored JSON files do not contain data about the competitions, so you won't get any data from
loader.competitions()
. - The competition_id, season_id and game_id have to be integers. This changed in v1.0.1
from socceraction.
Related Issues (20)
- Opta parser fails to recognize headed passes HOT 2
- Add pass height information to SPADL HOT 3
- Python 3.11 support HOT 4
- Path issue on Windows HOT 1
- Missing events whith OptaLoader HOT 1
- Add a SPADL action type for aerial duels
- WhoScored Parser Not Working DateTime Error HOT 3
- Handle games without actions
- Error with dribble after ball touch (Opta) HOT 5
- Problem xT Value HOT 1
- AttributeError: module 'numpy' has no attribute 'float'. HOT 3
- Pandas 2.0 Support HOT 1
- Support StatsBomb high fidelity x,y coordinates
- Support Opta -> kloppy -> SPADL
- Support Wyscout v2 -> kloppy -> SPADL
- Atomic SPADL - Mini dribbles added HOT 3
- "play_left_to_right" expected behaviour? HOT 4
- SPADL: Gamestate features with null result HOT 1
- SPADL: time_seconds_overall feature and periods
- Lack of compatibility with Wyscout Data: Event Data for one specific match HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socceraction.