Skip to main content

A package for validating common data format files

Project description

⚽ Common Data Format Schema Validator

JSON and JSONLines Schema Validition for the Soccer Common Data Format (Anzer et al. 2025)


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="cdf/files/sample/tracking_v0.2.0.jsonl")

# Example valid meta data
validator = cdf.MetaSchemaValidator()
validator.validate_schema(sample="cdf/files/sample/meta_v0.2.0.json")

# Example valid event data
validator = cdf.EventSchemaValidator()
validator.validate_schema(sample="cdf/files/sample/event_v0.2.0.jsonl")

# Example valid match data
validator = cdf.MatchSchemaValidator()
validator.validate_schema(sample="cdf/files/sample/match_v0.2.0.json")

# Example valid skeletal data
validator = cdf.SkeletalSchemaValidator()
validator.validate_schema(sample="cdf/files/sample/skeletal_v0.2.0.jsonl")

# Example valid video data
validator = cdf.VideoSchemaValidator()
validator.validate_schema(sample="cdf/files/sample/video_v0.2.0.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


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

common_data_format_validator-0.0.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

common_data_format_validator-0.0.2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file common_data_format_validator-0.0.2.tar.gz.

File metadata

File hashes

Hashes for common_data_format_validator-0.0.2.tar.gz
Algorithm Hash digest
SHA256 957273bfc31598bd5a66bf058248c3d7655f278a6528760d56363d045b1e41d9
MD5 784f39daa9563518c387b97ecaf0d5cd
BLAKE2b-256 16ad18d074302c2365ac90805e2e0124daef7a40c87db95b2f71d471d74a2e41

See more details on using hashes here.

File details

Details for the file common_data_format_validator-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for common_data_format_validator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e15f6928a9ec1339adee0ecdcec35bd50033669a1cef93dd85f53240e999c15
MD5 e5e6b13269fd1d7ff54b39136c4ddd88
BLAKE2b-256 1ce8dcaf89b3a438ba3f81897e644bcb76f33a8e2655469346e6e0f6ff924dd6

See more details on using hashes here.

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