Skip to main content

DO NOT USE THIS LIBRARY

Matthias Bussonnier was kind enough to point out that Paul Butler et al had written a library runipy that precede mine and is more mature. Consequently, this library, BatchNotebook is deprecated.

Please use: runipy instead.

Why Use This Library

  1. Explore data by writing an series of IPython notebooks.

  2. The Data are updated. Rerun all notebooks.

  3. Use nbconvert to generate reports from the executed notebooks.

This library saves time on step 2. That is, it allows you to rerun your notebooks from the command line, in batch mode, rather than running them manually or hacking together some browser runner with Selenium or something similar. It assumes that your executed notebook(s) will be used as a reporting tool (e.g. you want the inline html graphs.) If you do not need to use the executed notebook as a report, this library is not necessary; there are other scripts that can extract the code and turn it into a plain old py script.

According to this stackoverflow post, non-interactive IPython notebook execution will be added to the 2.0 core. Until then, I patched together this library from the work of others.

How To Use This Library

This library installs a script run_ipython_script.py. The following is the output of of run_ipython_script.py --help:

usage: run_ipython_script.py [-h] [--timeout TIMEOUT] [--verbose] src dst

Run IPython notebook scripts in batch mode.

positional arguments:
  src                   source notebook path
  dst                   destination notebook path

optional arguments:
  -h, --help            show this help message and exit
  --timeout TIMEOUT, -T TIMEOUT
                        max execution time in seconds per cell
  --verbose, -V         print status messages as processing proceeds

Caveats

Don’t use print. I’m not an IPython developer so I can’t explain why something does or does not work, but calls to print will break the output. Instead, do from IPython.display import HTML and return the HTML object in a cell where you want printed string output.

Contributing

If you have any bug fixes or contributions, please send a pull request to the BatchNotebook repository on github. However, please keep in mind this library is a temporary workaround to a problem that is being addressed by those developers who know IPython best. Therefore, you may want lend your typing hands to the next IPython 2.0 core, rather than me.

See also

This library was based off of: minrk’s script and davidshinn’s script.

Acknowledgements

This library was written to generate reports for a project funded by AFRL, managed by JHU/APL. I (John B Nelson) am the sole author, and I am responsible for any bugs or errors.

Metadata

Release files for BatchNotebook 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BatchNotebook 0.0.3
File Size Uploaded
BatchNotebook-0.0.3.tar.gz 4.2 kB Details

Release files / BatchNotebook-0.0.3.tar.gz

Download URL BatchNotebook-0.0.3.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea140d965e9c7f5227b7d1c6f7e5bcaf48fa93cec86bade49316d452d25354ff
BLAKE2b-256 checksum
How to use checksums
79354c7fbc800558f049f07317cb4454d9c471895591e247d0b28d7c04f32bd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page