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
./releasein your command line - Wait for the releases on GitHub, PyPi and PyPi (test)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_data_contract_standard-3.1.1.tar.gz.
File metadata
- Download URL: open_data_contract_standard-3.1.1.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d85e5920d51f41cca43056f9910f229e0b802466bea31edf0b3af67088875792
|
|
| MD5 |
7ae7312183690a742d33680385e93c11
|
|
| BLAKE2b-256 |
578c81b3675cc9f17bc98ef78556f5c0ab77bea7779a5f77d4aa7e202c20b677
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
open_data_contract_standard-3.1.1.tar.gz -
Subject digest:
d85e5920d51f41cca43056f9910f229e0b802466bea31edf0b3af67088875792 - Sigstore transparency entry: 749220686
- Sigstore integration time:
-
Permalink:
datacontract/open-data-contract-standard-python@41a79f28027af23bb719856eb06e494c90373eb8 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/datacontract
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@41a79f28027af23bb719856eb06e494c90373eb8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file open_data_contract_standard-3.1.1-py3-none-any.whl.
File metadata
- Download URL: open_data_contract_standard-3.1.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d22a68ddf8311e05b9b8972db1712ac159a988746c260baface4a8f2beb6fccf
|
|
| MD5 |
36036d85297df8af0f7904cf2ecee92f
|
|
| BLAKE2b-256 |
682cb6e7d1c9aacefab64bf5992e6ce50ae999a233915b53b1e4b0f3fe4bb1b9
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
open_data_contract_standard-3.1.1-py3-none-any.whl -
Subject digest:
d22a68ddf8311e05b9b8972db1712ac159a988746c260baface4a8f2beb6fccf - Sigstore transparency entry: 749220706
- Sigstore integration time:
-
Permalink:
datacontract/open-data-contract-standard-python@41a79f28027af23bb719856eb06e494c90373eb8 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/datacontract
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@41a79f28027af23bb719856eb06e494c90373eb8 -
Trigger Event:
push
-
Statement type: