whitespacerun
A Python tool to remove empty lines and clean up whitespace in Python files, with a special focus on removing unnecessary empty lines within functions.
Installation
Simply run:
pip install whitespacerun
That's it! All dependencies will be automatically installed.
Usage
You can use whitespacerun either as a command-line tool or as a library in your Python code.
Command Line Usage
# Clean a single file
whitespacerun run file.py
# Clean multiple files
whitespacerun run file1.py file2.py
# Clean all Python files in a directory
whitespacerun run .
Python Usage
from whitespace import clean_file
# Clean a single file
clean_file("path/to/your/file.py")
Features
- Removes empty lines within functions
- Preserves necessary whitespace for Python syntax
- Maintains code readability while reducing unnecessary spacing
- Supports both single file and directory processing
- Can be used as a CLI tool or Python library
Dependencies
All of these will be installed automatically when you install the package:
- click>=8.0.0 - For command line interface
- loguru>=0.7.0 - For logging
- pydantic>=2.0.0 - For data validation
- typing-extensions>=4.0.0 - For type hints
- rich>=13.0.0 - For beautiful terminal output
License
MIT License
Metadata
Release files for whitespacerun 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whitespacerun-0.1.0.tar.gz | 4.0 kB | Without provenance | Details for whitespacerun-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whitespacerun-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for whitespacerun-0.1.0-py3-none-any.whl |
Total release size: 11.3 kB
Release files / whitespacerun-0.1.0.tar.gz
| Download URL | whitespacerun-0.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e5f9f75823c0321d3c427363ee30dbd78396eafda3322915947ce3fc3560e12
|
|
BLAKE2b-256 checksum How to use checksums |
1cb00431ead8d1b35a74524bb30dfdc2e7939a9f99ff82c2f18ceaa53fa34818
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / whitespacerun-0.1.0-py3-none-any.whl
| Download URL | whitespacerun-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82ad11567835845007d9e0a6597a26660df4da10886620090ea4c89429999586
|
|
BLAKE2b-256 checksum How to use checksums |
a4c6439a9853a287577ef2fccadc5d54427cd8afd8fbc13a99858a5395b2be0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Security for whitespacerun 0.1.0
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.