Skip to main content

Clean Py

Overview

A small CLI program designed to automatically lint .ipynb and .py source code. Tidy and remove redundant imports (via autoflake), sort imports (via isort), lint and format source code in a standardised way (via black). Additionally, clear all .ipynb cell outputs and execution counts. Forked from KwatMe's orginal repo.

Install

Via pip:

pip install clean-py

Or clone directly:

git clone https://github.com/samhardyhey/clean_py
cd clean_py
pip install .

Usage

Clean a single file:

clean_py a_single_notebook.ipynb
clean_py a_single_script.py

Or recurse within a input dir:

clean_py <input_dir>

Clean with specific features if necessary:

clean_py <input_dir> -py True -isort True -black False -autoflake False

Tests

Simple pytesting via:

pytest

Multi-venv tox testing via:

tox

Dist

  • Update version within setup.py
  • Create dist .whl and .tar archives via:
python setup.py sdist bdist_wheel

Push to main pypi repo via:

twine upload dist/*

Metadata

Release files for clean-py 0.5

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

Source distribution (sdist)

Source distribution for clean-py 0.5
File Size Uploaded Provenance Actions
clean_py-0.5.tar.gz 4.7 kB Without provenance Details for clean_py-0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clean-py 0.5
File Interpreter ABI Platform Actions
clean_py-0.5-py3-none-any.whl Python 3 none any Details for clean_py-0.5-py3-none-any.whl

Total release size: 10.2 kB

Release files / clean_py-0.5.tar.gz

Download URL clean_py-0.5.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d70201a04f455114763c4714ebf322703586f6f5830da7203e2bff4db6027319
BLAKE2b-256 checksum
How to use checksums
7ab70dc1883bf2912b154b00383a43ac1925950b8a5076ffe9d08162f3568df7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / clean_py-0.5-py3-none-any.whl

Download URL clean_py-0.5-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af8dae559d852a05bb528cd311806e2c6823bda404fe6d5780d069df4e599a20
BLAKE2b-256 checksum
How to use checksums
c872b3ba5a2026bd9ad98ccda73f412e3ebac763443ed40dda41041da4ab5ed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Security for clean-py 0.5

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.5 This release

2 release files 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