A tool to remove empty lines and clean up whitespace in Python files
Project description
rigby
https://pypi.org/project/rigby/
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 rigby
That's it! All dependencies will be automatically installed.
Usage
You can use rigby either as a command-line tool or as a library in your Python code.
Command Line Usage
# Clean a single file
rigby run file.py
# Clean multiple files
rigby run file1.py file2.py
# Clean all Python files in a directory
rigby run .
Python Usage
from rigby 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
rm -rf dist/ && python3 -m build python3 -m twine upload dist/* pip uninstall -y rigby && pip install --no-cache-dir rigby
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rigby-0.1.1.tar.gz.
File metadata
- Download URL: rigby-0.1.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ab3e6df282adecf9d9c1a8c69f0936f06feb8b3df4f43d2d1dd6285dd9b8e6
|
|
| MD5 |
54a81764690d0923ca456a651b0d79ec
|
|
| BLAKE2b-256 |
baa7398f1477003ccef9ff6e173345d877e63f3a4afece59912c7710748aa5ac
|
File details
Details for the file rigby-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rigby-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
907b440e1cddb978d9ec56fbb77683993afbf6d42561c06e7219f2f23e957f0d
|
|
| MD5 |
e091eee93ba6d467c9e74c01678be3a7
|
|
| BLAKE2b-256 |
259de49326838ca0f88a7f7fa4589bc081fa798135311a88ad425a09b6be3389
|