skillfed

datacontract-specification

The Pydantic Model of the Data Contract Specification

datacontract-specification v1.2.3 1.3M downloads/30d#4,081 on PyPI3
Permissive license AGING released

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-specification

uv

uv add datacontract-specification

poetry

poetry add datacontract-specification

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

data contract yaml parserdatacontract specification pythonread write data contractspydantic data contract modelyaml data contract loader
data-contractsyaml-serialization

More Software Development packages