PyCdlib is a pure python library to parse, write (master), create, and manipulate ISO9660 files. These files are suitable for writing to a CD or USB.
The documentation for PyCdlib is split into several parts. If you are unfamiliar with the ISO and related standards, it is probably best to read the pages in order. If you already have a decent idea about ISO9660, Joliet, Rock Ridge, and UDF, you can skip directly to the examples.