Skip to content

changespec/changespec-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

changespec-py

Python types and validator for ChangeSpec 1.0 events.

Published as changespec on PyPI.

Install

pip install changespec

Requires Python 3.11+ and Pydantic 2.x.

Usage

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.HIGH

Also accepts a JSON string:

event = validate(json_string)

API

  • validate(data: dict | str) -> ChangeSpecEvent - parse and validate; raises ValidationError on failure
  • ChangeSpecEvent - Pydantic 2.x model with all fields typed
  • Category, Severity, SourceType, ReviewerRole - string enums
  • Signature - Ed25519 signature block model

Specification

ChangeSpec 1.0 - github.com/changespec/spec

License

Apache 2.0

About

Python types and validator for ChangeSpec 1.0 events

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages