Inventory and dependency analysis for COBOL modernization
Project description
COBOL Migration Toolkit
Beta — in active development. Interfaces may still change before 1.0. We're actively looking for feedback: please open an issue with what worked, what didn't, and what your COBOL estate needs.
A dependency-analysis and documentation scaffold for COBOL modernization projects.
Open-core: this repository is the free, Apache-2.0 discovery core. Deep grammar-based parsing, embedded SQL/CICS handling, AI documentation, SARIF/work-item export, and an assessment dashboard are part of Cartograph, the commercial tier — see
docs/ROADMAP.md.Your COBOL never leaves your network. The toolkit runs entirely locally with no telemetry, and Cartograph deploys inside your environment rather than ingesting your source — see
docs/DATA-HANDLING.md.
It scans COBOL and copybook files, extracts a useful first-pass inventory, and emits:
- JSON metadata
- Markdown documentation
- Graphviz DOT dependency graphs
The parser is intentionally conservative and regex-based. It is useful as a discovery tool and as a foundation for a proper grammar-based parser later.
Quick start
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
cobol-migrate scan examples --output build
# resolve COPY members from extra directories (repeatable):
cobol-migrate scan src --copybook-path copybooks --copybook-path shared/cpy --output build
# choose output formats (default: all) and fail CI on unresolved deps:
cobol-migrate scan src --format html --format json --output build
cobol-migrate scan src --strict --output build # exit 1 if anything is unresolved
# gate CI on any metric threshold (exit 1 if exceeded; default MAX is 0):
cobol-migrate scan src --fail-on unresolved_call_count --fail-on max_fan_in:20
# emit the JSON Schema for inventory.json (the downstream contract):
cobol-migrate schema --output inventory.schema.json
Generated files (subset selectable with --format {json,md,dot,html,all}):
build/inventory.json # versioned schema: units + metrics + unresolved deps
build/report.md # summary metrics, unresolved list, per-unit detail
build/report.html # self-contained report (stat tiles, filterable unit table, embedded graph)
build/dependencies.dot # combined call/copy graph; clustered by subsystem; unresolved red
build/calls.dot # call graph only
build/copybooks.dot # copybook graph only
Render the graph if Graphviz is installed:
dot -Tsvg build/dependencies.dot -o build/dependencies.svg
Run tests:
pytest
Configuration (.cobolmigrate.toml)
Keep project settings in a file instead of long command lines. The toolkit auto-discovers a
.cobolmigrate.toml in the scanned source directory (or the current directory), or point at one
with --config. CLI flags override the file; the file supplies defaults.
# .cobolmigrate.toml
copybook_paths = ["copybooks", "shared/cpy"] # resolved relative to this file
format = ["json", "html"]
strict = true
analyzers = ["all"]
extensions = [".cbl", ".cob", ".cpy"] # override the file-type allowlist
output = "build"
fail_on = ["unresolved_call_count", "max_fan_in:20"] # gate CI on metric thresholds
dialect = "ibm" # unknown keys pass through to analyzers
Analyzer plugins
Deeper analysis plugs into the core as analyzers discovered via the
cobol_migrate.analyzers entry-point group. The core ships one built-in reference analyzer
(paragraph_count); installed packages (e.g. the commercial Cartograph tier) register their
own and run automatically — no core changes required.
cobol-migrate scan src --analyzers all # default: every discovered analyzer
cobol-migrate scan src --analyzers none # inventory only
cobol-migrate scan src --analyzers paragraph_count
Analyzer output is merged into each unit under units[i].analyses.<name> in inventory.json.
Write your own by implementing the Analyzer protocol and registering it:
[project.entry-points."cobol_migrate.analyzers"]
my_analyzer = "my_pkg.module:MyAnalyzer"
Inventory analyzers are a second plugin type that run once over the whole built inventory (so they
can aggregate per-unit analyzer output — e.g. an estate-wide effort rollup). Their result lands in
top-level reports.<name> and is surfaced in the Markdown/HTML reports:
[project.entry-points."cobol_migrate.inventory_analyzers"]
my_rollup = "my_pkg.module:MyRollup"
See docs/SPEC.md for the Analyzer/ScanContext contract.
What the scanner finds
PROGRAM-IDCOPYdependencies (incl.COPY ... REPLACING, flagged for manual review)- static
CALLtargets - paragraph names
- source format (fixed vs free) and fixed-format continuation handling
- source file sizes and line counts
- copybook resolution against
--copybook-pathsearch paths - metrics: fan-in/fan-out, unreferenced programs/copybooks, unresolved dependencies
Suggested roadmap
- Replace regex extraction with an ANTLR or tree-sitter grammar.
- Add fixed-format COBOL column handling and continuation rules.
- Resolve copybooks from configurable search paths.
- Parse data definitions and build record-layout documentation.
- Track variable reads/writes and produce data-flow graphs.
- Detect dynamic calls and transaction boundaries.
- Add an optional LLM documentation adapter behind a clean interface.
- Export SARIF, OpenAPI candidate specs, or modernization work items.
Safety and accuracy
Treat generated output as an inventory aid, not authoritative program semantics. Real COBOL estates include vendor extensions, preprocessors, embedded SQL, CICS statements, generated code, and local conventions.
Roadmap & design
See docs/ROADMAP.md (incl. the open-core boundary) and docs/SPEC.md.
Part of the COBOL Modernization Starters
- cobol-rest-bridge — expose COBOL through REST
- cobol-migration-toolkit — inventory & dependency analysis (this repo)
- cobol-to-rust — a COBOL-to-Rust transpiler scaffold
Contributing
Contributions welcome — see CONTRIBUTING.md and the Code of Conduct. Report vulnerabilities per SECURITY.md.
License & commercial support
Licensed under the Apache License 2.0. © 2026 Make Directory Developers, LLC.
Need a full modernization assessment of your estate? Make Directory Developers offers mainframe & COBOL modernization services and Cartograph, an in-network assessment tier — mk-dir.com · andrew@mk-dir.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cobol_migration_toolkit-0.8.0.tar.gz.
File metadata
- Download URL: cobol_migration_toolkit-0.8.0.tar.gz
- Upload date:
- Size: 30.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c32a438e1cd62d2c0d3a6f357c6ae9365d2626801d5c592e9f3a42444b6e54e
|
|
| MD5 |
32188cdd02805de0e81336ccb45b2551
|
|
| BLAKE2b-256 |
25ea890285425d56b20215e6e910084479b1f24d461d2ee68c064f48333c6550
|
Provenance
The following attestation bundles were made for cobol_migration_toolkit-0.8.0.tar.gz:
Publisher:
release.yml on makedirectory/cobol-migration-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cobol_migration_toolkit-0.8.0.tar.gz -
Subject digest:
7c32a438e1cd62d2c0d3a6f357c6ae9365d2626801d5c592e9f3a42444b6e54e - Sigstore transparency entry: 2215324479
- Sigstore integration time:
-
Permalink:
makedirectory/cobol-migration-toolkit@2e2a9e0fadf9a19a4fc6f974d9f684bc03b4e7d6 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/makedirectory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2e2a9e0fadf9a19a4fc6f974d9f684bc03b4e7d6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cobol_migration_toolkit-0.8.0-py3-none-any.whl.
File metadata
- Download URL: cobol_migration_toolkit-0.8.0-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc4b0d3602a90b7ffa41d64c97970a39693ce61c52277ccf48ab31c71b556e70
|
|
| MD5 |
4400927c3906704f94b4e46d4cc594a7
|
|
| BLAKE2b-256 |
8e2d0ff3184b0ffdc9e357ed43e2fa0dd2cdf9d15a2a8a8580b1fdd8ca7868b7
|
Provenance
The following attestation bundles were made for cobol_migration_toolkit-0.8.0-py3-none-any.whl:
Publisher:
release.yml on makedirectory/cobol-migration-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cobol_migration_toolkit-0.8.0-py3-none-any.whl -
Subject digest:
fc4b0d3602a90b7ffa41d64c97970a39693ce61c52277ccf48ab31c71b556e70 - Sigstore transparency entry: 2215324495
- Sigstore integration time:
-
Permalink:
makedirectory/cobol-migration-toolkit@2e2a9e0fadf9a19a4fc6f974d9f684bc03b4e7d6 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/makedirectory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2e2a9e0fadf9a19a4fc6f974d9f684bc03b4e7d6 -
Trigger Event:
release
-
Statement type: