# nbcleanse 🚿
A notebook cleaner to end all notebook cleaners
## What?
It's a script that cleans [notebooks](https://jupyter.org/) of "redundant components" like metadata/output and etc.
## Why?
Because notebooks ARE code and whatever goes into your codebase should be as lean as possible.
Many IDEs which implement a notebook inteface (VScode, Jetbrains and etc.) add data to notebooks files in order to provide some functionalities. And that's a problem:
**It makes code reviews more difficult**
Notebook outputs clutter file data. Even with services such as reviewNB which allow simpler code reviews on notebook, cell outputs create a lot of false positive code changes.
**It is not consistant across IDEs**
Different IDEs can override the same settings causign unexpected behaviour.
**It is not consistant across developers**
The added settings can contain assumptions about dependencies that are computer-specific (conda environment, package versions). This can create conflicts when others pull the repo.
## Why nbcleanse?
Because it's lightweight, configureable and let's you know how many lines of code you've saved your repo - thus making you happy.
## OK. How?
First Install:
```bash
pip install nbcleanse
```
Then run:
```bash
cd your/notebooks/dir/
nbcleanse
```
## Can it do this or that?
It might! Currently supported features are:
```bash
# cleans all metadata from all notebooks in cwd
nbcleanse -m
# cleans all outputs
nbcleanse -o
# cleans all cell execution counts
nbcleanse -e
# quiet mode
nbcleanse -q
# flags are additive
nbcleanse -moeq
```
## It'd be nice if it could do this or the other thing...
Any suggesstions are welcome. Please open an issue or a PR explaining your idea!
Raw data
{
"_id": null,
"home_page": "https://github.com/shacharhelmer/nbcleanse/",
"name": "nbcleanse",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "jupyter,notebook,clean,clean notebook,clean jupyter notebook",
"author": "shachar helmer",
"author_email": "shachar.helmer@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c4/62/0693b639e4a03972bd3befa80775db186e81bdbdff73c43defe80e39190b/nbcleanse-0.0.3.tar.gz",
"platform": null,
"description": "# nbcleanse \ud83d\udebf\nA notebook cleaner to end all notebook cleaners\n\n## What?\n\nIt's a script that cleans [notebooks](https://jupyter.org/) of \"redundant components\" like metadata/output and etc.\n\n## Why?\n\nBecause notebooks ARE code and whatever goes into your codebase should be as lean as possible. \nMany IDEs which implement a notebook inteface (VScode, Jetbrains and etc.) add data to notebooks files in order to provide some functionalities. And that's a problem: \n\n**It makes code reviews more difficult** \nNotebook outputs clutter file data. Even with services such as reviewNB which allow simpler code reviews on notebook, cell outputs create a lot of false positive code changes. \n\n**It is not consistant across IDEs** \nDifferent IDEs can override the same settings causign unexpected behaviour. \n\n**It is not consistant across developers** \nThe added settings can contain assumptions about dependencies that are computer-specific (conda environment, package versions). This can create conflicts when others pull the repo.\n\n## Why nbcleanse?\n\nBecause it's lightweight, configureable and let's you know how many lines of code you've saved your repo - thus making you happy. \n\n## OK. How?\n\nFirst Install:\n```bash\npip install nbcleanse\n```\nThen run:\n```bash\ncd your/notebooks/dir/\nnbcleanse\n```\n\n## Can it do this or that?\n\nIt might! Currently supported features are:\n\n```bash\n# cleans all metadata from all notebooks in cwd\nnbcleanse -m\n\n# cleans all outputs\nnbcleanse -o\n\n# cleans all cell execution counts\nnbcleanse -e\n\n# quiet mode\nnbcleanse -q\n\n# flags are additive\nnbcleanse -moeq\n```\n\n## It'd be nice if it could do this or the other thing...\n\nAny suggesstions are welcome. Please open an issue or a PR explaining your idea! \n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "A library for cleaning jupyter notebooks real good",
"version": "0.0.3",
"split_keywords": [
"jupyter",
"notebook",
"clean",
"clean notebook",
"clean jupyter notebook"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2cd11367a4c412f8b9a7b00a1ffc14e2a49cdb7b5a37c823f033f3c42d8f27b5",
"md5": "54a09aa96d162b7e190fdf479b305ad1",
"sha256": "fc48167fafd5236e784a8281d3afa124f2535a1e63f27c7c32c418bc310ea96d"
},
"downloads": -1,
"filename": "nbcleanse-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "54a09aa96d162b7e190fdf479b305ad1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6145,
"upload_time": "2023-01-23T14:17:48",
"upload_time_iso_8601": "2023-01-23T14:17:48.946218Z",
"url": "https://files.pythonhosted.org/packages/2c/d1/1367a4c412f8b9a7b00a1ffc14e2a49cdb7b5a37c823f033f3c42d8f27b5/nbcleanse-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c4620693b639e4a03972bd3befa80775db186e81bdbdff73c43defe80e39190b",
"md5": "2a783f7057fca5f87ffc5a9109ca8f51",
"sha256": "d98803ebeefad7432fcd1184a9a8613496d89108eeeaf1e4448e46ee10c6e587"
},
"downloads": -1,
"filename": "nbcleanse-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "2a783f7057fca5f87ffc5a9109ca8f51",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5817,
"upload_time": "2023-01-23T14:17:51",
"upload_time_iso_8601": "2023-01-23T14:17:51.162563Z",
"url": "https://files.pythonhosted.org/packages/c4/62/0693b639e4a03972bd3befa80775db186e81bdbdff73c43defe80e39190b/nbcleanse-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-23 14:17:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "shacharhelmer",
"github_project": "nbcleanse",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nbcleanse"
}