Finding it troublesome to export images from notebook?
Junix is a simple python package to export plots within Jupyter Notebook.
Output formats include a directory of images or a PDF file (via img2pdf).
pip install junix
git clone https://github.com/powerpak/JupyterNotebookImageExporter.git
cd JupyterNotebookImageExporter; python setup.py install
junix /path/to/notebook -o path/to/output/directory
filepath: Notebook filepath
-o is an optional argument. If -o is not specified, output directory is current directory (pwd).
import junix; junix.export_images(filepath, output_dir)
filepath: Notebook filepath
output_dir: Directory where to output notebook images
junix /path/to/notebook -p path/to/output.pdf
or from Python,
import junix; junix.export_pdf(filepath, output_pdf)
Let's consider the following notebook example.ipynb
:
By running the following commands:
junix example.ipynb
(with command line)import junix; junix.export_images(filepath="example.ipynb")
(within python terminal)
2 image files will be generated in the same folder as the notebook file (see screenshot below):
This project is licensed under the MIT license (see LICENSE.txt). It was forked from damienmarlier51's repo which is also MIT licensed.