Skip to main content

Jupyter notebook cleanup

Working with PyCharm and your Jupyter notebooks becoming quite heavy and slow down your system? This project contains some tools to cleanup you Jupyter notebooks.

Usage

You may want to remove the output of all cells since loading the notebook takes ages. You can either use jp-cleanup on the command line or programmatically.

Command-line

At first, install jp-cleanup with pip using the version on GitHub

pip install git+https://github.com/larsklitzke/jp-cleanup.git

or on PyPi

pip install jp-cleanup

After installation, you can clear the output fields of a notebook test-notebook with

jp-cleanup --file test-notebook.ipynb --clear

with --clear being an extra flag to not remove the output of a notebook accidentally.

To list all available parameters or view the current version, run jp-cleanup with the --help flag.

jp-cleanup --help

Python

Instead of running jp-cleanup on the command-line, you can also use the package in Python. To remove the outputs of a certain jupyter notebook test-notebook, load the file

import jpcleanup as jpc

path, content = jpc.load('test-notebook') # or with .ipynb

reset the output of all cells

content = jpc.clear_field(content)

and write the result back to either the same file

jpc.save(content, path) 

or a new file

jpc.save(content, 'test-result') # or with .ipynb

Installation

Either clone this project with

git clone https://github.com/larsklitzke/jp-cleanup

to extend the functionality of the project or, since the the project is hosted on PyPi, install it with

pip install jp-cleanup

or

pip install git+https://github.com/larsklitzke/jp-cleanup.git

License

Copyright (C) 2019 Lars Klitzke, Lars.Klitzke@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Metadata

Release files for jp-cleanup 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for jp-cleanup 0.1.1
File Interpreter ABI Platform Actions
jp_cleanup-0.1.1-py3-none-any.whl Python 3 none any Details for jp_cleanup-0.1.1-py3-none-any.whl

Release files / jp_cleanup-0.1.1-py3-none-any.whl

Download URL jp_cleanup-0.1.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f10d77a4a9c120606332c8b02ddd25d3d7cfc4dad91b966aff3ba3cdefae1abb
BLAKE2b-256 checksum
How to use checksums
1d549b730d1d2f7bec9771b04c314e22a3243afc8935733077a0dbf7ac04d64d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.5.2

Security for jp-cleanup 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page