ipynbcompress API reference

ipynbcompress package

ipynbcompress.compress(filename, output_filename=None, img_width=2048, img_format='png')[source]

Compress images in IPython notebooks.

Parameters:
  • filename (string) – Notebook to compress. Will take any notebook format.
  • output_filename (string) – If you do not want to overwrite your existing notebook, supply an filename for the new compressed notebook.
  • img_width (int) – Which width images should be resized to.
  • img_format (string) – Which compression to use on the images, valid options are png and jpeg (requires libjpeg).
Returns:

Size of new notebook in bytes.

Return type:

int