A tool for renaming files or folders.
Project description
Introduction
Once in a lifetime of a computer user is the need to rename multiple folders or files. Normally, the user will try to find all the locations of the folders or files to be renamed one by one starting from a starting folder (i.e. target folder). Some sample use cases that multiple renaming is done by the user are the following:
Copied a bunch of template folders and files and then renamed them accordingly.
Downloaded a bunch of episode of a TV series and the user has his/her own file naming convention.
A java developer is duplicating a big working package where the source files have embedded acronyms where he needs to rename those with a new the acronym.
Without a simple tool, these use cases are very time consuming to accomplish. This is the motivation that made this simple Name Modifier project to exist.
The Package
Name Modifier is normally package in zip file with the following naming convention:
namemod-<version>.zip
If the latest distribution is 0.1 version then this will be packaged as:
namemod-0.1.zip
This package is normally downloadable in address below:
If the user had Python 3.4 installed, he/she doesn’t need to download just use the pip module (see Installing the module using pip).
Installing the Package
The installation is as easy as downloading the package and extracting it to wherever directory the user needs it to be. Moreover, it is recommended to include the installation directory to the users PATH environment variable.
Installing the module using pip
If the user had Python 3.4 installed, he/she can just use the pip module by running the command in Command 1.
Command 1. Using pip module for installation
python -m pip install namemod
Using the namemod command
Name Modifier can be used as easy as the other command line (e.g. dir) known to the user. The main command in this package is namemod. This command has many arguments that the user can opt to. If the user opted to install namemod using pip module (see Installing the module using pip), all the commands in the following sections can be carried out by using python with the following format found in Command 2:
Command 2. Using namemod with python
python -m namemod [optional arguments] <folder> <old_name_segment> <new_name_segment>
The -h or –help argument
Normally the first thing to do is to know how to use the command. This can be accomplished quickly by the -h or –help argument. For example, execute the command found in Command 3.
Command 3. Using -h argument
python -m namemod –h
The output would be the one shown in Listing 1.
Listing 1. –h argument output
usage: namemod [-h] [-f] [-F] [-i] [-I] [-m {text,regex}] [-n] [-R] [-xr regex] [-xt text] [-Xr regex] [-Xt text] [-v] folder old_name_segment new_name_segment Simplifying multiple files or folders renames. positional arguments: folder Specifies the target folder to process. old_name_segment Old name segment to be renamed. new_name_segment New name segment. optional arguments: -h, --help show this help message and exit -f, --file-only Process only files. -F, --folder-only Process only folders. -i, --interactive Ask confirmation before renaming. -I, --include-target-folder Include the target folder in renaming. -m {text,regex}, --mode {text,regex} Default: text -n, --noop Inhibit the actual renamig but display the intended outcome. -R, --recursive Recursive -xr regex, --exclude-file-regex regex Exclude files by regex. -xt text, --exclude-file-text text Exclude files by exact text match. -Xr regex, --exclude-folder-regex regex Exclude folders by regex. -Xt text, --exclude-folder-text text Exclude folders by exact text match. -v, --version show program's version number and exit
For more information about the usage, please download the user guide from https://sourceforge.net/projects/namemodifier/files
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.