Skip to main content

whitespaces

https://pypi.org/project/whitespaces/ 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 whitespaces

That's it! All dependencies will be automatically installed.

Usage

You can use whitespaces either as a command-line tool or as a library in your Python code.

Command Line Usage

# Clean a single file
whitespaces run file.py

# Clean multiple files
whitespaces run file1.py file2.py

# Clean all Python files in a directory
whitespaces 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 whitespaces 0.1.0

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

Source distribution (sdist)

Source distribution for whitespaces 0.1.0
File Size Uploaded Provenance Actions
whitespaces-0.1.0.tar.gz 2.0 kB Without provenance Details for whitespaces-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whitespaces 0.1.0
File Interpreter ABI Platform Actions
whitespaces-0.1.0-py3-none-any.whl Python 3 none any Details for whitespaces-0.1.0-py3-none-any.whl

Total release size: 6.3 kB

Release files / whitespaces-0.1.0.tar.gz

Download URL whitespaces-0.1.0.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3640bf11d23cc8989cda6e93dce7526cfcc533cfb3484798364c226074b1b9a9
BLAKE2b-256 checksum
How to use checksums
00992c8f1f59f04f2b693ebb492f9584c520ccadacb1c14cee89426fc85deec5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / whitespaces-0.1.0-py3-none-any.whl

Download URL whitespaces-0.1.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc74863fb7fbdd84978d0192f0aa3803bb407e955990038c94e35d84640ab9b0
BLAKE2b-256 checksum
How to use checksums
16e77db77ebc423a25618b69ba462fa21b1273418ab5baa27e4bcc8bffdae126
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for whitespaces 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.

Release history Release notifications | RSS feed

This release

0.1.0 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