From c7f157d214e649e5baa4f265017656236feb664d Mon Sep 17 00:00:00 2001 From: Koen Vossen Date: Thu, 18 Jun 2020 12:59:25 +0200 Subject: [PATCH] update readme and bump version --- README.md | 32 +++++++++++++++++++++++++++++++- setup.py | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c63d00fb..df29126e 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,16 @@ different tracking- and event data like a breeze. It aims to be the fundamental ## Main Features Here are just a few of the things that kloppy does well: +#### Loading data - Directly load [**Public datasets**](#datasets) to get started right away. - Understandable [**Standardized models**](#models) for tracking- and event datasets - Out-of-the-box [**(De)serializing**](#serializing) tracking- and event data from different sources into standardized models and vice versa +#### Processing data - Flexible [**pitch dimensions**](#pitch-dimensions) transformer for changing a dataset pitch dimensions from one to another (eg OPTA's 100x100 -> TRACAB meters) - Intelligent [**orientation**](#orientation) transforming orientation of a dataset (eg from TRACAB fixed orientation to "Home Team" orientation) +#### Pattern matching - Search for [**complexe patterns**](examples/pattern_matching/repository/README.md) in event data. +- Use `kloppy-query` to export fragments to XML file ## Where to get it @@ -44,6 +48,7 @@ from kloppy import ( load_tracab_tracking_data, load_epts_tracking_data, load_statsbomb_event_data, + load_opta_event_data, to_pandas, transform ) @@ -55,8 +60,10 @@ dataset = load_tracab_tracking_data('meta.xml', 'raw_data.txt') # or epts dataset = load_epts_tracking_data('meta.xml', 'raw_data.txt') -# or event data +# or event data: statsbomb dataset = load_statsbomb_event_data('event_data.json', 'lineup.json') +# opta +dataset = load_opta_event_data('f24_data.xml', 'f7_data.xml') dataset = transform(dataset, pitch_dimensions=[[0, 108], [-34, 34]]) @@ -172,6 +179,29 @@ with open("events/123123.json", "rb") as event_data, \ ``` +or Opta event data +```python +from kloppy import OptaSerializer + +serializer = OptaSerializer() + +with open("f24_data.xml", "rb") as f24_data, \ + open("f7_data.xml", "rb") as f7_data: + + dataset = serializer.deserialize( + inputs={ + 'f24_data': f24_data, + 'f7_data': f7_data + }, + options={ + "event_types": ["pass", "shot"] + } + ) + + # start working with dataset +``` + + ### Transform the pitch dimensions Data providers use their own pitch dimensions. Some use actual meters while others use 100x100. Use the Transformer to get from one pitch dimensions to another one. diff --git a/setup.py b/setup.py index 0b19a788..6391f46f 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="kloppy", - version="0.5.3", + version="0.6.0", author="Koen Vossen", author_email="info@koenvossen.nl", url="https://github.com/PySport/kloppy",