{"id":24165,"library":"openjd-model","title":"Open Job Description Model for Python","description":"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.","status":"active","version":"0.9.1","language":"python","source_language":"en","source_url":"https://github.com/OpenJobDescription/openjd-model-for-python","tags":["openjd","job-description","template","validation","aws"],"install":[{"cmd":"pip install openjd-model","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core validation framework used for model definitions.","package":"pydantic","optional":false},{"reason":"For YAML parsing of templates.","package":"pyyaml","optional":false}],"imports":[{"note":"JobTemplate is directly exported from openjd.model; the submodule path is incorrect.","wrong":"from openjd.model.template import JobTemplate","symbol":"JobTemplate","correct":"from openjd.model import JobTemplate"},{"note":"parse function is the recommended way to load templates from YAML or dict.","symbol":"parse","correct":"from openjd.model import parse"}],"quickstart":{"code":"from openjd.model import parse, JobTemplate\n\n# Load from a YAML string\ntemplate_yaml = \"\"\"\nspecificationVersion: 'jobtemplate-2023-09'\nname: Example Job\nsteps:\n- name: Step1\n  script:\n    actions:\n      onRun:\n        command: echo\n        args: ['{{Param.param1}}']\n  parameterValues:\n  - name: param1\n    type: STRING\n    value: hello\n\"\"\"\ntemplate = parse(template_yaml, JobTemplate)\nprint(template.name) # Example Job","lang":"python","description":"Parses a minimal job template YAML and prints the job name."},"warnings":[{"fix":"Update type annotations to accept int | FormatString where appropriate.","message":"In version 0.9.0, field types changed from Optional[int] to Optional[int | FormatString]. Code that relies on integer types may fail type checking.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"When creating these objects manually, pass the context (e.g., from a template's model_info).","message":"In version 0.8.0, DynamicConstrainedStr or FormatString creation requires a model parsing context (specification version and extensions). Instantiation without context raises an error.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Use parse function or direct model construction instead.","message":"The function instantiate_model is deprecated in 0.8.0; it no longer accepts optional 'loc' and 'within_field' arguments.","severity":"deprecated","affected_versions":">=0.8.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install openjd-model","cause":"Installing the wrong package or missing dependency 'openjd-model'.","error":"ModuleNotFoundError: No module named 'openjd'"},{"fix":"Ensure all required fields like 'name' in steps are provided. Check the schema for mandatory attributes.","cause":"Missing required fields in the template YAML.","error":"pydantic_core._pydantic_core.PydanticCustomError: 1 validation error for JobTemplate\n  -> steps\n    -> 0\n      -> name\n        Field required"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}