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)
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.
from cdf import (
TrackingSchemaValidator,
MetaSchemaValidator,
EventSchemaValidator,
MatchSchemaValidator
)
# Example valid tracking data
validator = TrackingSchemaValidator()
validator.validate_schema(
sample="cdf/files/sample/tracking_v0.2.0.jsonl"
)
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 in CDF Appendix C Figure 7
The validator (currently) does not check:
- British spelling
- Correct pitch dimensions
- 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
Changelog
See CHANGELOG.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file common_data_format_validator-0.0.1.tar.gz.
File metadata
- Download URL: common_data_format_validator-0.0.1.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d15d511248955b6ba2a7cfa1de1a385b5339912dec32d65d2c04df4d256bd73
|
|
| MD5 |
53b03293e403b6c93b645024265266bb
|
|
| BLAKE2b-256 |
981a26f7379d0f2b393dbfcad81e1d96ae266acfd5512c3f8417f187da0f83dd
|
File details
Details for the file common_data_format_validator-0.0.1-py3-none-any.whl.
File metadata
- Download URL: common_data_format_validator-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b845f6e0de4402b305dbb249af50472a8ae1effaa1ad111d29da0b319186d74f
|
|
| MD5 |
0dbc9b7d2614f7768e12710a653b6e91
|
|
| BLAKE2b-256 |
7608724520e42ac68be4948aa0731f2cf92d79c026916fa5d2722c850a25fc2a
|