Skip to main content

A data parser for StatsBomb soccer data using duckdb

Project description

duckstatsbomb

A data parser for StatsBomb soccer data using duckdb

StatsBomb open-data

Competitions data

from duckstatsbomb import Sbopen
parser = Sbopen()
df_competitions = parser.competitions()

Matches data

from duckstatsbomb import Sbopen
parser = Sbopen()
df_matches = parser.matches(2, 44)

List valid data types

from duckstatsbomb import Sbopen
parser = Sbopen()
print(parser.valid_data())

The valid kind values are:

  • 'lineup_players'
  • 'events'
  • 'frames'
  • 'tactics',
  • 'related_events'
  • 'threesixty_frames'
  • 'threesixty'

Data from one match

from duckstatsbomb import Sbopen
parser = Sbopen()
df_lineup_players = parser.match_data(3749052, kind='lineup_players')

Data from multiple matches

from duckstatsbomb import Sbopen
parser = Sbopen()
df_events = parser.match_data([3749052, 3749522], kind='events')

Data from one competition

from duckstatsbomb import Sbopen
parser = Sbopen()
df_tactics = parser.competition_data(competition_id=16, kind='tactics')

Data from one competition/season

from duckstatsbomb import Sbopen
parser = Sbopen()
df_frames = parser.competition_data(competition_id=16, season_id=37, kind='frames')

StatsBomb API

You can either provide the username and password as arguments (sb_username/ sb_password), or set the SB_USERNAME and SB_PASSWORD environmental variables.

Competitions data

from duckstatsbomb import Sbapi
parser = Sbapi()
df_competitions = parser.competitions()

Matches data

from duckstatsbomb import Sbapi
parser = Sbapi()
df_matches = parser.matches(2, 44)

List valid data types

from duckstatsbomb import Sbapi
parser = Sbapi()
print(parser.valid_data())

The valid kind values are:

  • 'lineup_players'
  • 'events'
  • 'frames'
  • 'tactics',
  • 'related_events'
  • 'threesixty_frames'
  • 'threesixty',
  • 'lineup_events'
  • 'lineup_formations'
  • 'lineup_positions',
  • 'threesixty_visible_count'
  • 'threesixty_visible_distance'

Data from one match

from duckstatsbomb import Sbapi
parser = Sbapi()
df_lineup_players = parser.match_data(3749052, kind='lineup_players')

Data from multiple matches

from duckstatsbomb import Sbapi
parser = Sbapi()
df_events = parser.match_data([3749052, 3749522], kind='events')

Data from one competition

from duckstatsbomb import Sbapi
parser = Sbapi()
df_tactics = parser.competition_data(competition_id=16, kind='tactics')

Data from one competition/season

from duckstatsbomb import Sbapi
parser = Sbapi()
df_frames = parser.competition_data(competition_id=16, season_id=37, kind='frames')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duckstatsbomb-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

duckstatsbomb-0.1.0-py2.py3-none-any.whl (26.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file duckstatsbomb-0.1.0.tar.gz.

File metadata

  • Download URL: duckstatsbomb-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for duckstatsbomb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 87ddfbdc097c5c52cd1dd1722095ec19e782d34d2abb59aae000b10dfa152755
MD5 121d4cb02d54dbbd8323a6366df58b00
BLAKE2b-256 4b999c3097261401073db23f03155aa8a7c6a929f9a804ea87fe01cee13a356b

See more details on using hashes here.

File details

Details for the file duckstatsbomb-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for duckstatsbomb-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f840adf8a2597aa0ae4896b00edf15f4170d39e5f39f6b18e5da2ebc6c747771
MD5 1f5c55ed8f12912dfb12e18bbaaa392e
BLAKE2b-256 e9a799a56f76861da8c43a0fafa5c7ea313e0711661fc2f142c508c166b818d1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page