Skip to main content

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

  1. Implement the Canonical Contract Model.
  2. Implement ODCS import.
  3. Implement Pydantic model generation.
  4. Implement record and JSON validation.
  5. Implement Pandas and Polars validation.
  6. Implement contract diffing.
  7. Implement CLI.
  8. Implement exports.
  9. Implement plugin system.
  10. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contractmodel-0.1.0.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contractmodel-0.1.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

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

Hashes for contractmodel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20c8f772a73681374739762be2a53b55aa5aa1fada43f14f6038c12984412c28
MD5 ee11d39ff4b4d7a4c3ec4674370e21b2
BLAKE2b-256 5770b1ce494506a9311dd6537096de200e10fded56bad225d0afa6b60171af02

See more details on using hashes here.

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

Hashes for contractmodel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43703e8211597bbf35002dbcb45b16373f00fde9867d0533ba9591713009b2f6
MD5 f8a247f910eccb32a72b5bbeedb1a965
BLAKE2b-256 ece647c86e4feb05b83507076734a4d483951009f47d098fe88042d933a47daf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page