Python types and validator for ChangeSpec 1.0 events.
Published as changespec on PyPI.
pip install changespecRequires Python 3.11+ and Pydantic 2.x.
from changespec import validate
event = validate({
"specversion": "1.0",
"id": "cs_01HY1234ABCD",
"vendor_id": "stripe",
"category": "api_breaking",
"severity": "high",
"title": "confirm() now requires return_url",
"summary": "The confirm() method now requires return_url.",
"published_at": "2026-04-10T14:00:00Z",
"source_type": "publisher_verified",
})
print(event.vendor_id) # "stripe"
print(event.category) # Category.API_BREAKING
print(event.severity) # Severity.HIGHAlso accepts a JSON string:
event = validate(json_string)validate(data: dict | str) -> ChangeSpecEvent- parse and validate; raisesValidationErroron failureChangeSpecEvent- Pydantic 2.x model with all fields typedCategory,Severity,SourceType,ReviewerRole- string enumsSignature- Ed25519 signature block model
ChangeSpec 1.0 - github.com/changespec/spec
Apache 2.0