David Watson
David Watson

Reputation: 3432

How do I cron an ipython jupyter notebook's cells?

I have an ipython jupyter notebook that I've developed and run from Django 1.8 with:

manage.py shell_plus --notebook

Within the notebook I have written some data analytics and reporting modules that produce CSV and HTML output via petl and pandas.

I'd like to automate the notebook in such a way that I can simply cron the notebook cells to execute and then serve the static HTML output, but I don't see a way to run the cells within the notebook without a human driving the process, i.e. from cron.

Upvotes: 1

Views: 3957

Answers (1)

Thomas K
Thomas K

Reputation: 40340

Nbconvert has a --execute flag to run a notebook before converting it to another format.

So for instance, to run a notebook and convert to static HTML:

ipython nbconvert --execute --to html MyNotebook.ipynb

If you want to run it and save the results as an ipynb file, you can use --to notebook.

Upvotes: 2

Related Questions