PyCdlib is a pure Python library designed to parse, create, and manipulate ISO9660 files, suitable for writing to a CD or USB. It supports various extensions including El Torito, Joliet, Rock Ridge, and UDF. The current stable version available on PyPI is 1.14.0, and it maintains a relatively active development and release cadence.
pip install pycdlibVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a new ISO image, add a directory and a file to it, and then write the ISO to a local file. It includes support for Joliet and Rock Ridge extensions during creation and file addition.
Ensure your project runs on Python 3.x.
Call `iso.force_consistency()` if you need to ensure all internal metadata is up-to-date before inspection or complex operations.
For problematic non-standard ISOs, consider reporting an issue to the project's GitHub, ideally with a link to the ISO for analysis.
Install from GitHub if 1.15.0+ features are required: `pip install git+https://github.com/clalancette/pycdlib.git`
Ensure all ISO9660 filenames and extensions use only uppercase letters, numbers, and underscores. For extensions, the format should typically be `/FILENAME.EXT;VERSION`. To use a wider range of characters or longer names, initialize the ISO with Joliet or Rock Ridge extensions, or set a higher `interchange_level` (e.g., `iso.new(joliet=True, rock_ridge='1.09')`).
Shorten filenames and extensions to comply with the 8.3 format (e.g., `MYFILE.TXT`). Alternatively, initialize the ISO with a higher `interchange_level` (e.g., `iso.new(interchange_level=3)`) or enable Joliet/Rock Ridge extensions when creating the ISO to allow for longer filenames.
Explicitly create all necessary parent directories within the ISO using `iso.add_directory()` before attempting to add files to those paths. The root directory `/` is always present by default.
pycdlib has limited support for UDF-only ISOs; it is designed for UDF 'Bridge' format alongside ISO9660. For UDF-only disks, this library may not be suitable, and an alternative solution or ensuring the ISO is in a compatible 'Bridge' format would be required.
No dependency data recorded yet.