Skip to content

Instantly share code, notes, and snippets.

@dominiquesydow
Created April 30, 2019 13:57
Show Gist options
  • Save dominiquesydow/6a01fcef45b6912be058f5b1d2484bad to your computer and use it in GitHub Desktop.
Save dominiquesydow/6a01fcef45b6912be058f5b1d2484bad to your computer and use it in GitHub Desktop.
Run jupyter notebooks from the command line
# Run Jupyter notebooks via the console
# Here: TeachOpenCADD talktorials on https://github.com/volkamerlab/TeachOpenCADD
# Change to TeachOpenCADD directory
#cd /path/to/TeachOpenCADD
# Activate TeachOpenCADD conda environment
#conda activate teachopencadd
# Install kernelspec teachopencadd
#python -m ipykernel install --user --name teachopencadd
##########################################################
# Example talktorial
##########################################################
# Run Jupyter notebook
jupyter nbconvert --execute talktorials/1_ChEMBL/T1_ChEMBL.ipynb
# Will generate an html file (T1_ChEMBL.html) showing the executed Jupyter notebook
##########################################################
# Iterate all talktorials
##########################################################
# Run iteratively all Jupyter notebooks in directory
for i in talktorials/*/*.ipynb; do echo; echo $i; jupyter nbconvert --execute --ExecutePreprocessor.kernel_name=teachopencadd --ExecutePreprocessor.timeout=300 $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment