Skip to content

Latest commit

 

History

History
100 lines (75 loc) · 2.51 KB

README.md

File metadata and controls

100 lines (75 loc) · 2.51 KB

NBCAT

nbcat is a command line tool for viewing jupyter notebook files in terminal. It parses notebook's underlying json content, hence it runs without the dependency of jupyter/ipython core.

Install

pip install git+https://github.com/ktw361/nbcat.git

No python? Checkout the c++ implementation.

Usage

nbcat example.ipynb

Example notebook (link)

nb

  • Running with nbcat examples/example-cifar10.ipynb -a:
Output (click to expand)
=========================================================================
# `markdown`
# CIFAR - 10 
## Decode data
=========================================================================
# `markdown`
Activate virtual environment
=========================================================================
# In [1]: 
%%bash
source ~/kerai/bin/activate
=========================================================================
# `markdown`
### Imports
=========================================================================
# In [2]: 
%matplotlib inline
from helper import get_class_names, get_train_data, get_test_data, plot_images
-------------------------------------------------------------------------
# `stderr`
Using TensorFlow backend.

=========================================================================
# `markdown`
Get class names
=========================================================================
# In [3]: 
class_names = get_class_names()
class_names
-------------------------------------------------------------------------
# `stdout`
Decoding file: data/batches.meta

# Out[3]: 
['airplane',
 'automobile',
 'bird',
 'cat',
 'deer',
 'dog',
 'frog',
 'horse',
 'ship',
 'truck']
=========================================================================

Use nbcat with grep to get rid of annoying image datas

  • output of cat:

grep_cat

  • output of `nbcat':

grep_nbcat

Uninstall

pip uninstall nbcat

License

Distributed under the MIT LICENSE.

Acknoledgement

Example notebook from: https://github.com/09rohanchopra/cifar10/blob/master/cifar10-basic.ipynb