PyBoost is a comprehensive toolkit for cleaning, optimizing, and improving Python code. It integrates multiple tools into a single, easy-to-use package.
PyBoost combines the following tools:
- pybackup - Create backups of Python files with timestamps
- rmcm - Remove comments and docstrings (optional)
- autoflake - Remove unused imports and variables
- pyupgrade - Upgrade to modern Python syntax
- isort - Sort imports
- black - Format code
- ruff - Lint and check for errors
- mypy - Static type checking (optional)
- bandit - Security checks (optional)
- vulture - Find dead code (optional)
The package is available on PyPI as pyboost-toolkit.
Note: While the package name is
pyboost-toolkit, the command-line tools are still namedpyboost,pybackup, etc.
pip install pyboost-toolkitpip install pyboost-toolkit[all]pip install pyboost-toolkit[dev]pyboost /path/to/your/python/projectusage: pyboost [-h] [--no-bak] [--backup-dir BACKUP_DIR] [--skip SKIP]
[--aggressive] [--backup-only] [--list-tools] [--verbose]
directory
Ultimate Python Code Maintenance Toolkit
positional arguments:
directory Directory containing Python files to process
options:
-h, --help show this help message and exit
--no-bak Skip creating backup files (backups are stored in the
codebase by default)
--backup-dir BACKUP_DIR
Directory to store backups (default: <codebase>/backup)
--skip SKIP Comma-separated list of tools to skip (e.g.,
'rmcm,mypy,bandit')
--aggressive Enable aggressive mode (includes comment removal and
other potentially destructive operations)
--backup-only Only create backups, don't process files
--list-tools List all available tools and exit
--verbose, -v Enable verbose output
pyboost ~/projects/my_python_projectpyboost ~/projects/my_python_project --skip=mypy,bandit,vulturepyboost ~/projects/my_python_project --aggressivepyboost ~/projects/my_python_project --backup-onlypyboost ~/projects/my_python_project --backup-dir ~/backups/python_projectsPyBoost also provides access to individual tools:
Create backups of Python files with timestamps.
pybackup /path/to/your/python/projectRemove comments and docstrings from Python files.
pyrmcm input_file.py output_file.pyFormat Python files by removing comments and applying Black.
pyformat /path/to/your/python/projectContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository from GitHub
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.