Skip to main content

Remove code from HTML files rendered from Jupyter notebooks

Project description

# `notebook_cleaner`

A command line tool for removing code blocks and prompts from an HTML export of an iPython notebook.

## Why?

You want to do some data analysis in iPython and you want to show your results to someone who doesn't care to see your code.

## Usage

notebook_cleaner <infile> [<outfile>]
notebook_cleaner (-h | --help)

-h --help Prints this message
-f --force Don't prompt if a file is goint to be overwritten

If `<outfile>` doesn't exist or matches `<infile>`, you'll be prompted to verify it's okay to overwrite `<infile>`.

## An example

$ cd examples
$ ipython nbconvert my_notebook.ipynb
... nbconvert just created the new file examples/my_notebook.html ...
$ python my_notebook.html clean_notebook.html
New file: clean_notebook.html

[Here is link to the *before* picture](
[... and a link to the *after* picture](

## To do
- Need to work out the removal of warnings.
- Images also leave behind some undesireable junk.
- More edge cases could become apparent with use

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for notebook_cleaner, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size notebook_cleaner-0.1.1-py2.py3-none-any.whl (4.8 kB) File type Wheel Python version 2.7 Upload date Hashes View hashes
Filename, size notebook_cleaner-0.1.1.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page