ipynb2viewer - Afternoon hack

ipython nbconvert has lot of handy options to convert ipynb to markdown, html etc… But I wanted to upload ipynb to gist.github.com and create a link in nbviewer.ipython.org. Started with curl and soon realized, it is getting messy. So wrote a small python program ipynb2viewer, Source code.

Install

Usage

Upload all ipynb files in the given path to gist.github.com and return nbviewer urls.

Upload mentioned file to gist.github.com and return nbviewer url.

Upload mentioned file to gist.github.com and open nbviewer url in webbrowser.

Upload all ipynb files in the given path to gist.github.com and open nbviewer urls in webbrowser.

Example

➜  ipynb2viewer git:(master) ipynb2viewer all tests --open

Uploaded test.ipynb file to gist https://gist.github.com/8081202
nbviewer url: http://nbviewer.ipython.org/gist/anonymous/8081202
Uploaded try.ipynb file to gist https://gist.github.com/8081203
nbviewer url: http://nbviewer.ipython.org/gist/anonymous/8081203