Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/i008/clean_ipynb

cleanup messy jupyter notebooks
https://github.com/i008/clean_ipynb

autoflake autopep8 ipynb jupyter jupyter-notebook linting notebook

Last synced: about 1 month ago
JSON representation

cleanup messy jupyter notebooks

Awesome Lists containing this project

README

        

### cleanipynb

[![](https://img.shields.io/pypi/v/clean_ipynb.svg)](https://pypi.python.org/pypi/cleanipynb)
[![](https://img.shields.io/travis/i008/clean_ipynb.svg)](https://travis-ci.org/i008/clean_ipynb)

This package will cleanup your jupyter notebook by:

- removing unused imports (globally)
- moving all imports to the first cell and reordering them
- reformatting your code with autopep8

All this with preserving the cell structure thanks to jupytext smart export to python features.

> **WARNING**: Cleaning happens in-place - Be careful

### Usage:

```bash
pip install cleanipynb
cleanipynb path_to_your_notebook.ipynb
```

### Demo:
![](beforeafter.gif)

### Credits:

- jupytext
- importanize
- autoflake
- autopep8