A batch renaming script to remove substrings from filenames and directories.
Project description
# Butch Filename Substring Remover
This is a batch renaming script to remove substrings from filenames and directories.
## Installation
You can install this package using pip:
```bash
pip install butch_filename_substring_remover
Usage
Command Line
butch-rename /path/to/directory substring1 substring2
As a Module
from butch_filename_substring_remover import rename_directory
root_directory = '/path/to/directory'
substrings_to_remove = ['substring1', 'substring2']
try:
rename_directory(root_directory, substrings_to_remove)
print("Renaming completed successfully.")
except Exception as e:
print(f"An error occurred: {e}")
Example
Assume you have a directory with the following files:
/example_dir
file1_test.txt
file2_sample.txt
subdir1_test
Running the following command:
butch-rename /example_dir test sample
will rename the files to:
/example_dir
file1_.txt
file2_.txt
subdir1_
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file butch_filename_substring_remover-0.1.1.tar.gz.
File metadata
- Download URL: butch_filename_substring_remover-0.1.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6bdccdbcd9e9d135b6bcfc32f24acd2ffeab045b3d047e7f8bff5f7e711f9e4
|
|
| MD5 |
1ebd6dcf59748b967b9da8faf20eca22
|
|
| BLAKE2b-256 |
8af64102d85c1c35a0e5f4e6dede60ffb1ac998b862362ec74580cf9bbcc0906
|
File details
Details for the file butch_filename_substring_remover-0.1.1-py3-none-any.whl.
File metadata
- Download URL: butch_filename_substring_remover-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
106cb58a394c4ca0b99cbb56e40289feec0e4fa1a4b16aad78f091b9830f5e7b
|
|
| MD5 |
50b3606be8e377f6ada225e8b86d050c
|
|
| BLAKE2b-256 |
4f53a1d18aa9d7cdf246ac180095fc2f01e74eaa041ad9ed30f62ec353dcaf55
|