This script will generate a 2D image of the chemical diagram for the contents of a supported structure file (e.g. a .cif or a .mol2). The image will be saved as a PNG in the workind directory. An image will be generated for everything in the structure file, i.e. if there are 3 structures in your .cif, you will get three diagrams generated.
Run the script from the command line, for instance:
python diagram_to_file.py crystal.cif
will generate diagrams for whatever is contained in "crystal.cif".
The functions in this script could also easily be used as part of a larger script to generate tailored reports using the CSD Python API.