Skip to main content

The Pydantic Model of the Open Data Contract Standard

Project description

Open Data Contract Standard (Python)

The pip module open-data-contract-standard to read and write YAML files using the Open Data Contract Standard. The pip module was extracted from the Data Contract CLI, which is its primary user.

The version number of the pip module corresponds to the version of the Open Data Contract Standard it supports.

Version Mapping

Open Data Contract Standard Version Pip Module Version
3.0.1 >=3.0.1
3.0.2 >=3.0.4
3.1.0 >=3.1.0

Note: We mirror major and minor version from the ODCS to the pip module, but not the patch version!

Installation

pip install open-data-contract-standard

Usage

from open_data_contract_standard.model import OpenDataContractStandard

# Load a data contract specification from a file
data_contract = OpenDataContractStandard.from_file('path/to/your/data_contract.yaml')
# Print the data contract specification as a YAML string
print(data_contract.to_yaml())
from open_data_contract_standard.model import OpenDataContractStandard

# Load a data contract specification from a string
data_contract_str = """
version: 1.0.0
kind: DataContract
id: 53581432-6c55-4ba2-a65f-72344a91553b
status: active
name: my_table
apiVersion: v3.1.0
"""
data_contract = OpenDataContractStandard.from_string(data_contract_str)
# Print the data contract specification as a YAML string
print(data_contract.to_yaml())

Development

uv sync --all-extras

Release

  • Change version number in pyproject.toml
  • Run ./release in your command line
  • Wait for the releases on GitHub, PyPi and PyPi (test)

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

open_data_contract_standard-3.1.2.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

open_data_contract_standard-3.1.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file open_data_contract_standard-3.1.2.tar.gz.

File metadata

File hashes

Hashes for open_data_contract_standard-3.1.2.tar.gz
Algorithm Hash digest
SHA256 9da18e1e961388bca6110e5a394c85bdf69de3e9966b2acf3f81f0092694d714
MD5 b2f20e47dc27af4e53a770b8928efd40
BLAKE2b-256 4e8a81076b5398c08444f50f749a363f43f0f063b05f7de232da7437129ef458

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_data_contract_standard-3.1.2.tar.gz:

Publisher: release.yaml on datacontract/open-data-contract-standard-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_data_contract_standard-3.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for open_data_contract_standard-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da801b93af6f18704100387a830388c7d78f8811ce834d84505241f22b882213
MD5 b7bf53cc5a09fe87594cb8d768d9fc1c
BLAKE2b-256 bf9ced60cc0d1fcbfe9605abf7449f0301d215d15db8a000f3b2402c04407789

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_data_contract_standard-3.1.2-py3-none-any.whl:

Publisher: release.yaml on datacontract/open-data-contract-standard-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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