Skip to main content

Standardizing soccer tracking- and event data

Project description

klop·pen (klopte, heeft geklopt) - juist zijn; overeenkomen, uitkomen met: dat klopt, dat kan kloppen is juist; dat klopt als een zwerende vinger dat is helemaal juist

PyPI Latest Release Downloads Powered by PySport

Soccer Data Processing, Simplified

Each data provider uses its own proprietary formats, event definitions, and coordinate system to capture soccer match data. This lack of standardization makes it difficult to build software or perform analysis across multiple providers. Kloppy solves this challenge by introducing a vendor-independent data model for both event and tracking data. It also streamlines data preprocessing, ensuring seamless integration into your data analysis and video analysis workflows. By standardizing and simplifying access to soccer match data, kloppy aims to be an essential building block for anyone working with soccer data.

Table of Contents

Supported data providers

Kloppy provides support for loading data from the following providers:

Provider Event Data Tracking Data Public Data Docs Notes
DataFactory
Hawkeye (2D) Joint tracking data is not yet supported
Impect
Metrica
PFF
SecondSpectrum
Signality
SkillCorner
Sportec
StatsBomb Includes 360 freeze frame data support
Stats Perform Includes support for MA1, MA3, and MA25 data feeds
Opta Includes support for F7, F24 and F73 XML data feeds
Tracab
Wyscout Includes support for v2 and v3 data

✓ Implemented    ⧗ In progress or partial support

Main features

Here are just a few of the things that kloppy does well.

🗄️ Loading data

Kloppy implements a standardized data model that can load event and tracking data from the most common data providers, supporting both public and proprietary data. Moreover, it does not matter where or how the data is stored: kloppy can handle compressed files and load data directly from the cloud.

from kloppy import sportec

dataset = sportec.load_open_event_data(match_id="J03WMX")

🔍 Querying data

Video analysts spend a lot of time searching for bespoke moments. Often, these moments follow recognizable patterns—like pass, pass, shot. Kloppy provides a powerful search mechanism based on regular expressions, enabling you to find these bespoke moments more quickly and easily.

goals = dataset.filter("shot.goal")

🔄 Transforming data

Different data providers use different coordinate systems, which can make combining datasets challenging. Additionally, it can be convenient to change the orientation of the data or normalize pitch dimensions for specific analyses. Kloppy handles these data transformations seamlessly.

goals_ltr = goals.transform(
    to_coordinate_system="opta",
    to_orientation="ACTION_EXECUTING_TEAM"
)

💾 Exporting data

Once your data is in the right shape, export it as a Polars or Pandas dataframe for efficient analysis, or as SportsCode XML to support your video analysis workflow. Kloppy's data model is also compatible with other popular soccer analytics libraries.

df_goals = goals_ltr.to_df(
  "player", 
  "coordinates_*", 
  assist=lambda event: event.prev("pass"),
  engine="polars"
)

Where to get it

The source code is hosted on GitHub at: https://github.com/PySport/kloppy.

The easiest way to install kloppy is via pip:

pip install kloppy

You can also install from GitHub for the latest updates:

pip install git+https://github.com/PySport/kloppy.git

For more details, refer to the installation guide.

Documentation

The official documentation is hosted at https://kloppy.pysport.org.

Contributing to kloppy

Kloppy can only exist because of a passionate and dedicated open-source community. All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. An overview on how to contribute can be found in the contributing guide.

Made with contrib.rocks.

Sponsors

Kloppy is powered by PySport (non-profit, RSIN: 866294211). Consider contributing or donating to ensure its longevity!

License

Kloppy is distributed under the terms of the BSD 3 license.

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

kloppy-3.18.0.tar.gz (224.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kloppy-3.18.0-py3-none-any.whl (294.7 kB view details)

Uploaded Python 3

File details

Details for the file kloppy-3.18.0.tar.gz.

File metadata

  • Download URL: kloppy-3.18.0.tar.gz
  • Upload date:
  • Size: 224.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kloppy-3.18.0.tar.gz
Algorithm Hash digest
SHA256 684f03fb228290592fbc2fd180f7d428aeb21d001c5f6c6d3361a21ef92fa17b
MD5 78c03f2814a2adac7f7299dcad38c6f8
BLAKE2b-256 fb41d456e664badb4f289f58ffd864a33ac55650a64000a2549b45d2da207b28

See more details on using hashes here.

Provenance

The following attestation bundles were made for kloppy-3.18.0.tar.gz:

Publisher: release.yml on PySport/kloppy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kloppy-3.18.0-py3-none-any.whl.

File metadata

  • Download URL: kloppy-3.18.0-py3-none-any.whl
  • Upload date:
  • Size: 294.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kloppy-3.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc5087a2e8fe32a4095ba24498b5838eac8724354b99e5695b5b05c469bb63fe
MD5 905bd6ed10f4bebd40a6c36d047d47ac
BLAKE2b-256 75797da8eae36417749744e1364adaaff16749aa22b6b023c8acbe8eda30bb79

See more details on using hashes here.

Provenance

The following attestation bundles were made for kloppy-3.18.0-py3-none-any.whl:

Publisher: release.yml on PySport/kloppy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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