-
Notifications
You must be signed in to change notification settings - Fork 0
Home
小树 edited this page May 2, 2026
·
4 revisions
High-performance APICORE parser and validator for APICORE v1 and v2.
Version 2.0.0 is a full rewrite of the old 1.0.0 package line, while keeping full APICORE v1 support and adding native APICORE v2 support.
uv add APICORE_Pythonor
pip install APICORE_Pythonfrom apicore import __version__, load, loads
print(__version__)
document = load("example.api.yaml")
print(document.apicore_version)
inline = loads("""
friendly_name: Demo
link: https://api.example.com/v2/generate
func: POST
parameters:
- name: api_key
type: string
friendly_name: API Key
value: ''
response:
image:
content_type: URL
path: data.output.url
""", format="yaml")
validated = load("legacy.api.json", version="v1")
print(validated.friendly_name)-
apicore-validatevalidates one file from the command line. -
apicore-guiopens the desktop validator for batch inspection. -
load(),loads(), andvalidate()all return typedV1DocumentorV2Documentinstances.
- If
APICORE_versionis omitted, parsing defaults to v2. - Forcing
version="v1"orversion="v2"conflicts with a declared document version and raisesValidationError. - Disabled parameters may use an empty
friendly_name, but enabled parameters must still provide a non-empty label. -
response.image.pathmay be empty forBINARY, but URL responses still require a non-empty path.
A collaboration by Little Tree Studio and SRInternet Studio.
© 2026 Little Tree Studio & SRInternet Studio.
Licensed under CC BY-SA 4.0.