Skip to content

A collection of tools for Data Mesh architectural approach. Data Contract validation against Open Data Contract Standards.

License

Notifications You must be signed in to change notification settings

data-igor/Data_Mesh_Tools

 
 

Repository files navigation

DataMesh

A collection of tools for Data Mesh architectural approach.

Data Contract Validation

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

Installation

Install it from PyPi

pip install -U datamesh

Install latest nightly builds from git

pip install git+https://github.com/georgegach/DataMesh.git

Usage

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

streamlit app screenshot

Badges

ODCS JSON Schema is up-to-date

Contribution

Feel free to contribute to the project under free and open-source GPLv3 license.

Resources

About

A collection of tools for Data Mesh architectural approach. Data Contract validation against Open Data Contract Standards.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.7%
  • Shell 5.3%