jcl-parser
Python library for parsing IBM z/OS JCL (Job Control Language) into structured Job, Step, and DD objects. Supports PROC expansion, validation, lint rules, SQL detection, and dataset lifecycle analysis.
Install
pip install jcl-parser # from PyPI
pip install -e ".[dev]" # from a checkout, with the dev tools
Requires Python 3.10+. No runtime dependencies.
Quick Start
from pathlib import Path
import jclparser
job = jclparser.parse_jcl(Path("PAYROLL.jcl")) # a str is always JCL text, never a path
print(job.name)
for step in jclparser.iter_execution_steps(job.steps): # also walks IF/THEN/ELSE blocks
print(step.name, step.program or step.procedure)
exploded = jclparser.explode_job(job) # PROC expansion is a separate call
errors = jclparser.validate_jcl(
Path("PAYROLL.jcl"), level="structure"
) # list[ParseError]
print(job.to_json(indent=2)) # schema: jclparser.JOB_JSON_SCHEMA
CLI:
jcl-parser FILE steps # list all steps
jcl-parser FILE --validate # validate JCL
jcl-parser FILE lint # run lint rules
jcl-parser FILE --json # full parse result as JSON (job.to_dict())
jcl-parser --json-schema # JSON Schema of that document
jcl-parser DIR # cross-job dataset lineage of a directory of jobs
jcl-parser DIR lineage mermaid # ... as a Mermaid graph (or `dot`)
jcl-parser DIR lint --sarif # lint every job of a directory, as SARIF
jcl-lint jobs/ --fail-on warning --format sarif -o jcl.sarif # CI / pre-commit
Lint in CI
Configure the rules in pyproject.toml, and switch one off for one statement
with a comment:
[tool.jcl-parser.lint]
ignore = ["JCL-LINT-002"]
fail-on = "warning"
[tool.jcl-parser.lint.severity]
"JCL-LINT-004" = "warning"
//* jcl-lint: disable=JCL-LINT-001
//MASTER DD DSN=PROD.MASTER.FILE,DISP=SHR
pre-commit (.pre-commit-config.yaml):
- repo: https://github.com/landparty/jcl-parser
rev: v2.2.0 # first release with the hook
hooks:
- id: jcl-lint
GitHub Actions (findings appear in code scanning):
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: landparty/jcl-parser@v2.2.0 # first release with the action
with:
paths: jcl
glob: "**/*.jcl"
Commands
# Tests
pytest
pytest -m unit
# Lint / format / type-check
ruff check . && ruff format .
python scripts/mypy_ratchet.py # mypy strict against the known-error baseline, as CI runs it
# Vendor sync (after changes to jclparser/) — rm first: plain `cp -r` nests
# into dest/jclparser/jclparser/ and leaves stale files when dest exists
rm -rf ../backend/_vendor/jcl-parser/jclparser && cp -r jclparser/ ../backend/_vendor/jcl-parser/jclparser
Documentation
Full reference: .okf/index.md. Contributors: start with CLAUDE.md
(commands, architecture, invariants) and .okf/development/invariants.md.
Changes are listed in CHANGELOG.md (releases) and .okf/log.md.
License
GNU Affero General Public License v3.0 or later — Copyright © 2026 Samuel Dion. See LICENSE.
Metadata
Release files for jcl-parser 2.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jcl_parser-2.2.1.tar.gz | 231.5 kB | With provenance | Details for jcl_parser-2.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jcl_parser-2.2.1-py3-none-any.whl | Python 3 | none | any | Details for jcl_parser-2.2.1-py3-none-any.whl |
Total release size: 500.6 kB
Release files / jcl_parser-2.2.1.tar.gz
| Download URL | jcl_parser-2.2.1.tar.gz |
|---|---|
| Size | 231.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcfecd31c965626b36b974e300efcb3adff52ffe63112fe31bef0eb080ead609
|
|
BLAKE2b-256 checksum How to use checksums |
08827c1a28601ebff76326d2fa4c4bb431a7c7b5ffa5e5e10f4237d70d332d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / jcl_parser-2.2.1-py3-none-any.whl
| Download URL | jcl_parser-2.2.1-py3-none-any.whl |
|---|---|
| Size | 269.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
921338f6a149a77ac28ce3e999e921c15a1b403160558edce7da4be8319d9636
|
|
BLAKE2b-256 checksum How to use checksums |
96aac09aa2ba22a619c6f037ec91eaf6c732d0ceb12231ac3d31ab2a38a0d232
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for jcl-parser 2.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for jcl_parser-2.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.