Giter Club home page Giter Club logo

datamesh's Introduction

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

pip install -U datamesh

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

Contribution

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

Resources

datamesh's People

Contributors

georgegach avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.