Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

butch_filename_substring_remover-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file butch_filename_substring_remover-0.1.1.tar.gz.

File metadata

File hashes

Hashes for butch_filename_substring_remover-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c6bdccdbcd9e9d135b6bcfc32f24acd2ffeab045b3d047e7f8bff5f7e711f9e4
MD5 1ebd6dcf59748b967b9da8faf20eca22
BLAKE2b-256 8af64102d85c1c35a0e5f4e6dede60ffb1ac998b862362ec74580cf9bbcc0906

See more details on using hashes here.

File details

Details for the file butch_filename_substring_remover-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for butch_filename_substring_remover-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 106cb58a394c4ca0b99cbb56e40289feec0e4fa1a4b16aad78f091b9830f5e7b
MD5 50b3606be8e377f6ada225e8b86d050c
BLAKE2b-256 4f53a1d18aa9d7cdf246ac180095fc2f01e74eaa041ad9ed30f62ec353dcaf55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page