Skip to content

giantatwork/pybroom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pybroom

Pybroom is a command-line tool written in Rust for cleaning up Python bytecode files and directories, including __pycache__ directories and standalone .pyc and .pyo files.

Overview

Pybroom provides a simple, fast and efficient way to remove unnecessary Python bytecode files and directories from your project. It helps keep your project directories clean and organized by removing clutter generated during Python development. It can be employed, for instance, within a Git post-checkout hook, to mitigate conflicts during development.

Features

  • Recursively scans for __pycache__ directories and removes them entirely
  • Finds and removes standalone .pyc and .pyo bytecode files throughout the directory tree
  • Skip confirmation flag (-s, --skip-confirmation) to remove files/directories without confirmation
  • Verbose flag (-v, --verbose) to display detailed information about the cleaning process
  • Cross-platform support for Windows, macOS, and Linux

Getting Started

Prerequisites

Installation

To install Pybroom, run the following command inside the project directory:

cargo install --path .

Usage

Usage: pybroom [OPTIONS] <DIRECTORY>

Arguments:
  <DIRECTORY>  Directory to start searching

Options:
  -s, --skip-confirmation  Skip confirmation
  -v, --verbose            Verbose mode
  -h, --help               Print help
  -V, --version            Print version

Run pybroom . to clean the current directory. To clean another directory provide a path like this: pybroom my/path.

Pybroom will:

  • Remove all __pycache__ directories and their contents
  • Remove standalone .pyc and .pyo files found anywhere in the directory tree
  • Preserve all .py source files and other non-bytecode files

By default, Pybroom will ask for confirmation before removing files. Use the -s or --skip-confirmation flag to skip this prompt.

For more options, run pybroom --help.

License

Pybroom is licensed under the MIT License.

Acknowledgements

Pybroom was inspired by pyclean (https://github.com/bittner/pyclean)

About

Pybroom is a command-line tool for cleaning up Python bytecode files and directories, including __pycache__ directories and standalone .pyc and .pyo files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages