
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
datacontract-specification
Advanced tools
The pip module datacontract-specification
to read and write YAML files using the Data Contract Specification. 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 Data Contract Specification it supports.
Data Contract Specification Version | Pip Module Version |
---|---|
1.1.0 | >=1.1.0 |
Note: We mirror major and minor version from the Data Contract Specification to the pip module, but not the patch version!
pip install datacontract-specification
from datacontract_specification.model import DataContractSpecification
# Load a data contract specification from a file
data_contract = DataContractSpecification.from_file('path/to/your/data_contract.yaml')
# Print the data contract specification as a YAML string
print(data_contract.to_yaml())
from datacontract_specification.model import DataContractSpecification
# Load a data contract specification from a string
data_contract_str = """
dataContractSpecification: 1.1.0
id: urn:datacontract:checkout:orders-latest
info:
title: Orders Latest
version: 2.0.0
description: |
Successful customer orders in the webshop.
All orders since 2020-01-01.
Orders with their line items are in their current state (no history included).
owner: Checkout Team
status: active
contact:
name: John Doe (Data Product Owner)
url: https://teams.microsoft.com/l/channel/example/checkout
"""
data_contract = DataContractSpecification.from_string(data_contract_str)
# Print the data contract specification as a YAML string
print(data_contract.to_yaml())
uv sync --all-extras
pyproject.toml
./release
in your command lineFAQs
The Pydantic Model of the Data Contract Specification
We found that datacontract-specification demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.