A collection of tools for Data Mesh architectural approach.
The library can be used to validate your .yaml data contract against Open Data Contract Standard JSON schema from Bitol-io / open-data-contract-standard
pip install -U datamesh
data-contract-validation <path_to_contract_yaml_file> <optional_path_to_standards_json_schema>
or in Python
from datamesh.contract import Validator
validation_errors = (
Validator(
contract="examples/all/postgresql-adventureworks-contract.yaml",
standard="schema/odcs-json-schema.json" # This is optional
)
.print_report() # Prints validation results and returns `self`
.errors # List of errors
)
๐ฉ Validation errors:
.
โ
โโโ[]
โ โโโ 'datasetName' is a required property
โ
โโโ[]
โ โโโ 'quantumName' is a required property
โ
โโโ['kind']
โ โโโ 'managedDataset' is not one of ['DataContract']
can be used within your CI as
...
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install datamesh
- name: Run Data Contract Validation on all examples
run: |
set -o pipefail
failed_files=""
for file in examples/all/*.yaml; do
echo "Validating $file..."
if ! data-contract-validation "$file"; then
echo "Validation failed for $file"
failed_files="$failed_files $file"
fi
done
if [ -n "$failed_files" ]; then
echo "Validation failed for the following files:$failed_files"
exit 1
else
echo "All files validated successfully."
fi
...
Streamlit App at datamesh.streamlit.app
Feel free to contribute to the project under free and open-source GPLv3 license.