Python-native data contracts powered by a Canonical Contract Model and Pydantic.
Project description
ContractModel Implementation Blueprint
ContractModel is a Python-native data contract framework that uses a Canonical Contract Model (CCM) as the stable internal representation and bridges ODCS, Pydantic V2, Pandas, Polars, FastAPI, quality tools, registries, and semantic web standards.
This repository blueprint is designed to be handed directly to Cursor, Claude Code, or another AI coding assistant.
Build Order
- Implement the Canonical Contract Model.
- Implement ODCS import.
- Implement Pydantic model generation.
- Implement record and JSON validation.
- Implement Pandas and Polars validation.
- Implement contract diffing.
- Implement CLI.
- Implement exports.
- Implement plugin system.
- Implement semantic extensions.
Core Package
from contractmodel import DataContract
contract = DataContract.from_yaml("examples/customer_events.odcs.yaml")
CustomerEvent = contract.to_pydantic()
result = contract.validate_record({
"event_id": "550e8400-e29b-41d4-a716-446655440000",
"customer_id": "C123",
"event_timestamp": "2026-06-23T12:00:00Z"
})
Design Principle
The CCM must not mirror ODCS, Pydantic, JSON Schema, Avro, SQL, or any one vendor format. All external formats are adapters into and out of the CCM.
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 contractmodel-0.1.0.tar.gz.
File metadata
- Download URL: contractmodel-0.1.0.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c8f772a73681374739762be2a53b55aa5aa1fada43f14f6038c12984412c28
|
|
| MD5 |
ee11d39ff4b4d7a4c3ec4674370e21b2
|
|
| BLAKE2b-256 |
5770b1ce494506a9311dd6537096de200e10fded56bad225d0afa6b60171af02
|
File details
Details for the file contractmodel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: contractmodel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43703e8211597bbf35002dbcb45b16373f00fde9867d0533ba9591713009b2f6
|
|
| MD5 |
f8a247f910eccb32a72b5bbeedb1a965
|
|
| BLAKE2b-256 |
ece647c86e4feb05b83507076734a4d483951009f47d098fe88042d933a47daf
|