{"id":2213,"library":"pycdlib","title":"pycdlib","description":"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.","status":"active","version":"1.14.0","language":"en","source_language":"en","source_url":"http://github.com/clalancette/pycdlib","tags":["iso","cd","filesystem","archive","iso9660","joliet","rockridge","udf"],"install":[{"cmd":"pip install pycdlib","lang":"bash","label":"Install stable version from PyPI"}],"dependencies":[],"imports":[{"symbol":"PyCdlib","correct":"from pycdlib import PyCdlib"}],"quickstart":{"code":"from pycdlib import PyCdlib\nfrom io import BytesIO\nimport os\n\n# Create a new, empty ISO\niso = PyCdlib()\niso.new(interchange_level=3, joliet=True, rock_ridge='1.09')\n\n# Add a directory\niso.add_directory('/TESTDIR;1')\n\n# Add a file from a BytesIO object\nfile_content = b\"Hello, pycdlib!\\n\"\niso.add_fp(BytesIO(file_content), len(file_content), '/TESTFILE.TXT;1',\n           joliet_path='/testfile.txt', rock_ridge_path='testfile.txt')\n\n# Define output path (using a temporary file for quickstart example)\noutput_path = 'my_new_iso.iso'\n\n# Write the ISO to a file\ntry:\n    iso.write(output_path)\n    print(f\"Successfully created ISO image: {output_path}\")\nexcept Exception as e:\n    print(f\"Error creating ISO: {e}\")\nfinally:\n    iso.close()\n    # Clean up the created file for the quickstart example\n    if os.path.exists(output_path):\n        # os.remove(output_path) # Uncomment to clean up automatically\n        pass\n","lang":"python","description":"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."},"warnings":[{"fix":"Ensure your project runs on Python 3.x.","message":"Python 2.7 compatibility has been removed. PyCdlib versions 1.14.0 and later are strictly Python 3 compatible.","severity":"breaking","affected_versions":"<= 1.13.x"},{"fix":"Call `iso.force_consistency()` if you need to ensure all internal metadata is up-to-date before inspection or complex operations.","message":"PyCdlib employs a 'lazy' approach to updating ISO metadata for performance. This means that direct inspection of the `PyCdlib` object's internal metadata state might not always reflect the absolute latest changes until `force_consistency()` is explicitly called.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For problematic non-standard ISOs, consider reporting an issue to the project's GitHub, ideally with a link to the ISO for analysis.","message":"The library may throw `PyCdlibInvalidISO` or `PyCdlibInternalError` exceptions when encountering ISO files that do not strictly adhere to relevant standards.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install from GitHub if 1.15.0+ features are required: `pip install git+https://github.com/clalancette/pycdlib.git`","message":"Version 1.15.0 has been released on GitHub but is not yet available on PyPI (as of current date). Users wishing to access the absolute latest features or fixes must install directly from the GitHub repository rather than via `pip install pycdlib`.","severity":"gotcha","affected_versions":"1.15.0 (unreleased on PyPI)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}