Skip to content

Commit

Permalink
Merge pull request #61 from statsbomb/sub-player-id
Browse files Browse the repository at this point in the history
Add missing substitution cols
  • Loading branch information
scotty779 authored Mar 19, 2024
2 parents 29bb479 + 0ea18ad commit bf06ae9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="statsbombpy",
version="1.12.0",
version="1.13.0",
description="easily stream StatsBomb data into Python",
long_description=README,
long_description_content_type="text/markdown",
Expand Down
9 changes: 8 additions & 1 deletion statsbombpy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ def flatten_event(event, flatten_attrs):
for k, v in event.copy().items():
if isinstance(v, dict) and "name" in v:
event[k] = v["name"]
if k in ["possession_team", "player", "team", "pass_recipient"]:
if k in [
"possession_team",
"player",
"team",
"pass_recipient",
"substitution_outcome",
"substitution_replacement",
]:
event[f"{k}_id"] = v["id"]
return event

Expand Down

0 comments on commit bf06ae9

Please sign in to comment.