Bulk Rename
A CLI utility for bulk renaming files based on a pattern.
Installation
Install via pip:
pip install bulk-rename-signalsenryu
Or install via uv:
uv pip install bulk-rename-signalsenryu
Usage
After installation:
bulk-rename --help
Or run without installing:
# Using Python module
python -m bulk_rename --help
# Using uv run (from project directory)
uv run bulk-rename --help
# Using uvx (runs directly without installation)
uvx bulk-rename-signalsenryu --help
Available Options
-d, --path PATH Directory containing files to rename (required)
-p, --pattern PATTERN Naming pattern, e.g., "video_{:03d}" (required)
-e, --extension EXT File extension to filter, e.g., "mp4" (required)
-s, --start NUM Starting index for numbering (default: 1)
--version Show version and exit
Examples
Basic Usage
Suppose you have a directory with video files:
ls videos/
a.mp4 b.mp4 c.mp4
Rename them with zero-padded numbering:
bulk-rename -d ./videos -p "video_{:03d}" -e mp4
Or with uvx:
uvx bulk-rename -d ./videos -p "video_{:03d}" -e mp4
Preview and confirm:
✅ videos/a.mp4 -> videos/video_001.mp4
✅ videos/b.mp4 -> videos/video_002.mp4
✅ videos/c.mp4 -> videos/video_003.mp4
Proceed? (y/n): y
Result:
ls videos/
backup_2026-01-20_08-48-13.txt video_001.mp4 video_002.mp4 video_003.mp4
A backup file is automatically created:
cat videos/backup_2026-01-20_08-48-13.txt
videos/a.mp4 -> videos/video_001.mp4
videos/b.mp4 -> videos/video_002.mp4
videos/c.mp4 -> videos/video_003.mp4
Custom Starting Index
Start numbering from 10:
bulk-rename -d ./photos -p "IMG_{:02d}" -e jpg -s 10
Result:
photos/x.jpg -> photos/IMG_10.jpg
photos/y.jpg -> photos/IMG_11.jpg
photos/z.jpg -> photos/IMG_12.jpg
Handling Conflicts
If target files already exist, the tool detects conflicts:
❌ videos/video_001.mp4 -> videos/video_001.mp4 [Target file already exists]
Found 1 conflict
Continue with skipping conflicts? (y/n): n
Features
- ✅ Preview changes before applying
- ✅ Automatic conflict detection
- ✅ Asks for confirmation before renaming
- ✅ Backup file creation with timestamps
- ✅ Alphabetical sorting of source files
- ✅ Customizable numbering patterns
- ✅ Dry run mode
Development
Setup
Clone the repository and install in editable mode:
Using pip:
git clone https://github.com/signalsenryu/bulk-rename.git
cd bulk-rename
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[dev]"
Using uv:
git clone https://github.com/signalsenryu/bulk-rename.git
cd bulk-rename
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
Or even simpler with uv sync:
git clone https://github.com/signalsenryu/bulk-rename.git
cd bulk-rename
uv sync --extra dev
Run Tests
Using pip:
pytest tests/ -vv -s --cov=. --cov-report=term-missing
Using uv:
uv run pytest tests/ -vv -s --cov=. --cov-report=term-missing
Project Structure
bulk-rename/
├── src/
│ └── bulk_rename/
│ ├── __init__.py
│ ├── __main__.py
│ └── cli.py
├── tests/
│ └── test_cli.py
├── pyproject.toml
└── README.md
License
MIT License - see LICENSE file for details.
Metadata
Release files for bulk-rename-signalsenryu 0.1.2
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 |
|---|---|---|---|---|
| bulk_rename_signalsenryu-0.1.2.tar.gz | 8.6 kB | Without provenance | Details for bulk_rename_signalsenryu-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bulk_rename_signalsenryu-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for bulk_rename_signalsenryu-0.1.2-py3-none-any.whl |
Total release size: 16.0 kB
Release files / bulk_rename_signalsenryu-0.1.2.tar.gz
| Download URL | bulk_rename_signalsenryu-0.1.2.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c6acf5449b6342ad818caac6d2f859f41fd0009a8ce8d4aafa427916706fd6b
|
|
BLAKE2b-256 checksum How to use checksums |
a937696772103feff320fd59fb7a9aa769c764757c8d91c8f5e617f858f0de07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / bulk_rename_signalsenryu-0.1.2-py3-none-any.whl
| Download URL | bulk_rename_signalsenryu-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7517c5b1fb14fb86f45cf297641e574b5a5a211007894411f45026fb24e95b2a
|
|
BLAKE2b-256 checksum How to use checksums |
e0d183e2a37335c6b1dc3446a376b1493fd7985a6bab22f6fc61927ee7e0cd75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for bulk-rename-signalsenryu 0.1.2
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.