A simple, intuitive bulk file renaming tool with support for static patterns, regular expressions, and optional AI-generated names using Google Gemini.
- Static Pattern Renaming: Use patterns like
IMG_###.jpg
for sequential numbering - Regular Expression Support: Advanced search and replace with regex
- AI-Generated Names: Optional integration with Google Gemini for intelligent file naming
- Dry Run Mode: Preview changes before execution
- Input Validation: Comprehensive error handling and user confirmation
- Modular Design: Clean, extensible architecture for easy customization
# Clone the repository
git clone https://github.com/0x-Decrypt/bulk-renamer.git
cd bulk-renamer
# Install dependencies
pip install -r requirements.txt
# Or install directly with pip
pip install -e .
# Static pattern renaming
python -m bulk_renamer --directory ./photos --pattern "IMG_###.jpg"
# Regular expression renaming
python -m bulk_renamer --directory ./docs --regex "s/old_name/new_name/g"
# AI-generated names (requires API key)
python -m bulk_renamer --directory ./images --ai-rename --api-key your_gemini_key
# Dry run (preview only)
python -m bulk_renamer --directory ./files --pattern "doc_###.txt" --dry-run
Create a config.yaml
file:
gemini:
api_key: "your_api_key_here"
model: "gemini-2.0-flash-exp"
defaults:
dry_run: true
backup: true
confirmation: true
Run the test suite:
python -m pytest tests/ -v
The project follows a modular design with clear separation of concerns:
core/
- Core renaming logic and strategiesstrategies/
- Different renaming strategy implementationscli/
- Command-line interfaceconfig/
- Configuration managementutils/
- Utility functions and validation
- Fork the repository
- Create a feature branch
- Follow the coding guidelines (max 25 lines per function)
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details.