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
```
Usage:
notebook_cleaner <infile> [<outfile>]
notebook_cleaner (-h | --help)
Option:
-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 notebook_cleaner.py my_notebook.html clean_notebook.html
New file: clean_notebook.html
```
[Here is link to the *before* picture](https://htmlpreview.github.io/?https://github.com/RAvdek/notebook_cleaner/blob/master/examples/my_notebook.html)
[... and a link to the *after* picture](https://htmlpreview.github.io/?https://github.com/RAvdek/notebook_cleaner/blob/master/examples/clean_notebook.html)
## 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
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
```
Usage:
notebook_cleaner <infile> [<outfile>]
notebook_cleaner (-h | --help)
Option:
-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 notebook_cleaner.py my_notebook.html clean_notebook.html
New file: clean_notebook.html
```
[Here is link to the *before* picture](https://htmlpreview.github.io/?https://github.com/RAvdek/notebook_cleaner/blob/master/examples/my_notebook.html)
[... and a link to the *after* picture](https://htmlpreview.github.io/?https://github.com/RAvdek/notebook_cleaner/blob/master/examples/clean_notebook.html)
## 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
notebook_cleaner-0.1.1.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for notebook_cleaner-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51db28c000b4a08d5d5cf0d3fe51f64fe005f2a44d601443b2c7d76e053c695f |
|
MD5 | eb2a213a70e5005d3ac1adbfe8d893ff |
|
BLAKE2b-256 | 9e4b003f21bf6b628a95a685a94f8d667846d5f3394dc22a92ebb1081342a9d9 |