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.2.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.2.tar.gz.

File metadata

File hashes

Hashes for butch_filename_substring_remover-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e00f2f79120ea10593939fb7ef67810e4dbace00761954f2b52b7d7bf6509de3
MD5 7ea67f90fb2298bec9c2d53995f3d68c
BLAKE2b-256 242aa3537c9d60134ac890849a26135f4b5e605f1d01e6a0eed402cd7134735d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for butch_filename_substring_remover-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f8a5dcc47008ff697c284444254c675618a2faca242a4bb46bea92d671e254
MD5 e474ac1451b7790f6a950b273edd0002
BLAKE2b-256 61bd9dbe72862909385831d6999136bd7ec6451e54777618ebd69a1c159bb04f

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