A cross-platform CLI and Python module for extracting files from CDP/CHUMP archives used by Trainz.
The CLI or Python module can be installed in the following ways:
Download the standalone CLI executable from the Releases page for your operating system, then extract it somewhere you can find it.
See Usage for details on how to use the CLI.
pip install --upgrade cdpunpackIf you have downloaded a .whl file from the Releases page, install it with:
pip install path/to/cdpunpack-<version>‑py3‑none‑any.whlReplace <version> with the actual version number in the filename.
git clone https://github.com/pgroenbaek/cdp-unpack.git
pip install --upgrade ./cdp-unpack.\cdpunpack.exe input.cdp output_folder./cdpunpack input.cdp output_folderUse the --list parameter to list contents of a .cdp file, for example:
.\cdpunpack.exe --list input.cdppython3 -m cdpunpack input.cdp output_folderfrom pathlib import Path
from cdpunpack import parse_cdp, extract_document
input_path: Path = Path("path/to/input.cdp")
output_path: Path = Path("path/to/output")
data = input_path.read_bytes()
document = parse_cdp(data)
asset_count, file_count = extract_document(
document,
output_path,
)
print(f"Extracted Assets: {asset_count}")
print(f"Extracted Files: {file_count}")A Python 3.8+ installation is needed for building the module and standalone CLI executable.
In addition, Nuitka is required for building the standalone CLI executable, install it from pip using:
pip install "nuitka[onefile]"Run the following command in PowerShell:
.\tools\package_windows.ps1Run the following command in a terminal:
./tools/package_linux.shYou can run tests manually or use tox to test across multiple Python versions.
First, install the required dependencies:
pip install pytestThen, run tests with:
pytestFirst, install the required dependencies:
pip install tox pytestThen, run tests with:
toxThis will execute tests for all Python versions specified in tox.ini.
This project is a Python port/adaptation of the extraction-portion of cdptool.
The original code is Copyright (c) 2026 cdptool contributors and is licensed under the MIT License.
This Python implementation is also released under the MIT License.