Git Product home page Git Product logo

mynb's Introduction

https://github.com/amirhm/mynb/actions?query=workflow%3AWindows

Formating the jupyter notebooks

An small package to clear all the outputs of a jupyter notebooks.

To use versioning on the notebooks, it is practical to clear the outputs of all cells (to only keep the code). The outputs are written in the same notebook file in binary format (base64) and are huge in size and not suitable to be versioned.
This simple package adds a command to removes all the cell output (similar to invoking "Clear all outputs" from the jupyetr menu) and could be added on the pre-commit hooks.

Jupyter itself has a command to do this, but not very reliable always

jupyter nbconvert --clear-outputs ...

Install

pip install mynb

this will install the mynb as an standalone console application (CLI), where can be run from terminal.

>> mynb [filename] [options]

filename: filename or path to the ipynb, possible to use the wildcards
          to apply multiple notebooks (mynb *.ipynb) 
options:
  -h, --help     show this help message
  --inplace, -p  by default the command re-write the files, if this switch is use new file with "_cleared" suffix is created 
  --quite, -q    do not print anything  

mynb's People

Contributors

amirhm avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.