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.1.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.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for open_data_contract_standard-3.1.1.tar.gz
Algorithm Hash digest
SHA256 d85e5920d51f41cca43056f9910f229e0b802466bea31edf0b3af67088875792
MD5 7ae7312183690a742d33680385e93c11
BLAKE2b-256 578c81b3675cc9f17bc98ef78556f5c0ab77bea7779a5f77d4aa7e202c20b677

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_data_contract_standard-3.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for open_data_contract_standard-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d22a68ddf8311e05b9b8972db1712ac159a988746c260baface4a8f2beb6fccf
MD5 36036d85297df8af0f7904cf2ecee92f
BLAKE2b-256 682cb6e7d1c9aacefab64bf5992e6ce50ae999a233915b53b1e4b0f3fe4bb1b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_data_contract_standard-3.1.1-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