Registry / serialization / openjd-model

openjd-model

JSON →
library0.9.0pypypi✓ verified 83d ago

Provides a Python implementation of the data model for Open Job Description (OpenJD) template schemas. Version 0.9.1 is current, with monthly releases on GitHub. The library validates and parses OpenJD job and environment templates using Pydantic.

pip install openjd-model
INSTALL
IMPORT
SIG · OPENJD-MODEL
O
openjd-model
serializationpythonv0.9.0
Install
3.5s avg
Import
1044ms
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.084s · 30.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.5s · import 1.004s · 31MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JobTemplate
from openjd.model import JobTemplate
from openjd.model.template import JobTemplate
JobTemplate is directly exported from openjd.model; the submodule path is incorrect.
parse
from openjd.model import parse
parse function is the recommended way to load templates from YAML or dict.

Parses a minimal job template YAML and prints the job name.

from openjd.model import parse, JobTemplate # Load from a YAML string template_yaml = """ specificationVersion: 'jobtemplate-2023-09' name: Example Job steps: - name: Step1 script: actions: onRun: command: echo args: ['{{Param.param1}}'] parameterValues: - name: param1 type: STRING value: hello """ template = parse(template_yaml, JobTemplate) print(template.name) # Example Job
Debug
Known issues
breakingIn version 0.9.0, field types changed from Optional[int] to Optional[int | FormatString]. Code that relies on integer types may fail type checking.
fix
Update type annotations to accept int | FormatString where appropriate.
affects: >=0.9.0
breakingIn version 0.8.0, DynamicConstrainedStr or FormatString creation requires a model parsing context (specification version and extensions). Instantiation without context raises an error.
fix
When creating these objects manually, pass the context (e.g., from a template's model_info).
affects: >=0.8.0
deprecatedThe function instantiate_model is deprecated in 0.8.0; it no longer accepts optional 'loc' and 'within_field' arguments.
fix
Use parse function or direct model construction instead.
affects: >=0.8.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'openjd'
Installing the wrong package or missing dependency 'openjd-model'.
fix
Run: pip install openjd-model
pydantic_core._pydantic_core.PydanticCustomError: 1 validation error for JobTemplate -> steps -> 0 -> name Field required
Missing required fields in the template YAML.
fix
Ensure all required fields like 'name' in steps are provided. Check the schema for mandatory attributes.
Upgrade
Version history
0.9.0latest on PyPI · released Feb 3, 2026
Audit
Dependencies
pydanticrequiredCore validation framework used for model definitions.
pyyamlrequiredFor YAML parsing of templates.
Agent activity
6 hits · last 30 days
node
6
Resources
openjd-model — pip install openjd-model · libregistry