rigby
https://pypi.org/project/rigby/
A Python tool to clean up Python files by managing empty lines, with a focus on:
- Removing ALL empty lines within functions and classes
- Maintaining exactly one empty line between functions
- Maintaining exactly two empty lines between classes
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_source
# Clean a single file
clean_file("path/to/your/file.py")
# Clean source code directly
source = '''
class MyClass:
def foo():
print("hello")
print("world")
def bar():
print("bar")
'''
cleaned = clean_source(source) # Will remove empty lines within functions and format properly
Features
- Removes ALL empty lines within functions and classes
- Maintains exactly one empty line between functions
- Maintains exactly two empty lines between classes
- Preserves code functionality while cleaning up 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
Metadata
Release files for rigby 0.1.3
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 |
|---|---|---|---|---|
| rigby-0.1.3.tar.gz | 4.5 kB | Without provenance | Details for rigby-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rigby-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for rigby-0.1.3-py3-none-any.whl |
Total release size: 12.4 kB
Release files / rigby-0.1.3.tar.gz
| Download URL | rigby-0.1.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
004e95b5e7897e422ac7fc9edb9385b641f07c23ceb76b4b931c57ed99969b69
|
|
BLAKE2b-256 checksum How to use checksums |
3ea4d90902eb7b66a3844fe351fe61c692bbb09730737b3aa6ab4a4d30f5630f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / rigby-0.1.3-py3-none-any.whl
| Download URL | rigby-0.1.3-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d81bcede1be546bc6e1c439f11da16dc04b0c4fe9e067636a836cc77bf6e032
|
|
BLAKE2b-256 checksum How to use checksums |
635eeffc9dae8dc50eb188b7e12310c3241fd325afc018588336b1b5681c4b2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Security for rigby 0.1.3
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.