Skip to main content

⚽ Common Data Format Schema Validator

JSON and JSONLines Schema Validition for the Soccer Common Data Format.

Anzer, G., Arnsmeyer, K., Bauer, P., Bekkers, J., Brefeld, U., Davis, J., Evans, N., Kempe, M., Robertson, S. J., Smith, J. W., & Van Haaren, J. (2025). Common Data Format (CDF)—a Standardized Format for Match-Data in Football (Soccer). [Unpublished manuscript / Preprint].


Changelog

See CHANGELOG.md


How To

1. Install package

pip install common-data-format-validator

2. Create your own schema

Create your data schema according to the Common Data Format specificiations for any of:

  • Offical Match Data
  • Meta Data
  • Event Data
  • Tracking Data
  • Skeletal Tracking Data

3. Test your schema

Once you have created your schema, you can check it's validity using the available SchemaValidators for each of the above mentioned data types.

import cdf

# # Example valid tracking data
validator = cdf.TrackingSchemaValidator()
validator.validate_schema(sample=f"cdf/files/v{cdf.VERSION}/sample/tracking.jsonl")

# Example valid meta data
validator = cdf.MetaSchemaValidator()
validator.validate_schema(sample=f"cdf/files/v{cdf.VERSION}/sample/meta.json")

# Example valid event data
validator = cdf.EventSchemaValidator()
validator.validate_schema(sample=f"cdf/files/v{cdf.VERSION}/sample/event.jsonl")

# Example valid match data
validator = cdf.MatchSchemaValidator()
validator.validate_schema(sample=f"cdf/files/v{cdf.VERSION}/sample/match.json")

# Example valid skeletal data
validator = cdf.SkeletalSchemaValidator()
validator.validate_schema(sample=f"cdf/files/v{cdf.VERSION}/sample/skeletal.jsonl")

# Example valid video data
validator = cdf.VideoSchemaValidator()
validator.validate_schema(sample=f"cdf/files/v{cdf.VERSION}/sample/video.json")

Note

The validator checks:

  • All mandatory fields are provided
  • Snake case is adhered for each key and for values (except for player names, city names, venue names etc.)
  • Data types are correct (e.g. boolean, integer etc.)
  • Value entries for specific fields are correct (e.g. period type can only be one of 5 values)
  • Position groups and positions follow naming conventions

The validator (currently) does not check:

  • Correct JSONLines line separator ('\n')
  • Correct UTF-8 encoding
  • Correct pitch dimensions
  • British spelling
  • Color codes are hex (e.g. #FFC107)
  • If player_ids (or other ids) in meta are in tracking, event etc. or vice versa
  • Position labels fit within the formation specifications

Current Version of Common Data Format

This validator currently relies on CDF "alpha" version 2, but includes all logical changes not yet reflected in the text of this version, as discussed in the Changelog


Software by Joris Bekkers

Metadata

Release files for common-data-format-validator 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for common-data-format-validator 0.0.11
File Size Uploaded
common_data_format_validator-0.0.11.tar.gz 49.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for common-data-format-validator 0.0.11
File Interpreter ABI Platform
common_data_format_validator-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 126.3 kB

Release files / common_data_format_validator-0.0.11.tar.gz

Download URL common_data_format_validator-0.0.11.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
756308e0bd54a58d1935f5c99433f89ee8895930c2c838f363a11116ee7be1db
BLAKE2b-256 checksum
How to use checksums
f955c14d94f2898d7369e7753c4d41756f08bf05903e833c395e6d59885b0939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / common_data_format_validator-0.0.11-py3-none-any.whl

Download URL common_data_format_validator-0.0.11-py3-none-any.whl
Size 76.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84cb9396ddac5c4e831be858854fcb7039e6c72c094b395643fb2672c00560bc
BLAKE2b-256 checksum
How to use checksums
d87fa9ec0cec287d0fa705d8e50e7295b63324613f7deb07e45eb5d1187b4e60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

0.1.1

2 release files

0.1.0

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

This release

0.0.11 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page