datacontract-specification
The Pydantic Model of the Data Contract Specification
What it is and what it does
This package provides a Pydantic-based Python model for the Data Contract Specification, allowing you to load and serialize data contract YAML files programmatically. It was extracted from the Data Contract CLI as a standalone library and mirrors the major and minor version numbers of the specification it supports (1.2.x for spec 1.2.0). The package requires Python 3.10 or later and depends only on pydantic and pyyaml.
You use it to parse existing data contract YAML files into Python objects via from_file() or from_string(), inspect and manipulate the contract structure, and serialize it back to YAML. It's designed as a low-level serialization layer rather than a full data governance platform.
Use it for:
- Parse and validate data contract YAML files in Python applications that need to read contract metadata.
- Generate or modify data contract definitions programmatically before writing them back to YAML.
- Integrate data contract specifications into data pipeline orchestration or metadata management tools.
- Build tooling that needs to inspect contract structure without external CLI calls.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and writes YAML files conforming to the Data Contract Specification using Pydantic models, enabling programmatic access to data contract definitions.
Yes, if you need programmatic access to Data Contract Specification files in Python. The low install friction, permissive license, and small dependency footprint make it a reasonable choice. However, the aging maintenance status (323 days since last release) suggests checking whether the package is still actively developed before adopting it for critical workflows.
Install
datacontract-specification on PyPI
pip
pip install datacontract-specificationuv
uv add datacontract-specificationpoetry
poetry add datacontract-specificationInstalling datacontract-specification
Before you install
Low install friction with only two runtime dependencies (pydantic and pyyaml). Maintenance status is aging—last release was 323 days ago—but the repository remains active with a recent commit on 2025-09-25.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions, making it suitable for most projects.
Quickstart
pip install datacontract-specification
from datacontract_specification.model import DataContractSpecification
data_contract = DataContractSpecification.from_file('path/to/your/data_contract.yaml')
print(data_contract.to_yaml())
Requires Python 3.10 or later.
Verify before relying
- Whether the package is actively maintained beyond the most recent commit or if 323 days since release indicates stalled development.
- Whether version 1.2.3 fully supports all features of Data Contract Specification 1.2.0 or if there are known limitations.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pydantic, pyyaml |
| Maintenance | aging — 323 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,305,007/month — #4,081 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: datacontract_specification-1.2.3-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
datacontract-cliA CLI tool for defining, validating, and…
permissive · top 5,000 on PyPI
open-data-contract-standardReads and writes YAML files conforming to the…
permissive · top 5,000 on PyPI
pydantic_yamlPydantic-YAML adds YAML serialization and…
permissive · top 5,000 on PyPI
prime-pydantic-configBuilds a command-line interface from Pydantic…
unclear · top 15,000 on PyPI
agent-framework-declarativeEnables building agents from YAML…
permissive · top 15,000 on PyPI
openccu-loom-typesProvides generated Pydantic models and string…
permissive · top 15,000 on PyPI
openapi-schema-pydanticProvides Pydantic classes that map to the…
permissive · top 5,000 on PyPI
dydanticDynamically generates Pydantic models from JSON…
permissive · top 5,000 on PyPI
pydbmlPyDBML parses and generates DBML (Database…
permissive · top 15,000 on PyPI
pydantic-aiPydantic AI is a Python framework for building…
permissive · top 5,000 on PyPI