Package: namemod
IntroductionOnce 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 simpleName Modifierproject to exist.The PackageName Modifier has three packages for different OS:PackageDescriptionnamemod-<version>.zipContains the Python source codes and documents packaged for Windows and Python 3.4 is required.namemod-<version>.tar.gzContains the Python source codes and documents packaged for Linux and Python 3.4 is required.namemod-<version>.win-bin.zipContains binary for Windows which doesn’t need Python to be installedThese packages are normally downloadable in addresses below:https://pypi.python.org/pypi/namemodandhttps://sourceforge.net/projects/namemodifier/filesIf the user had Python 3.4 installed, he/she doesn’t necessary needs to download this binary. The user can just use the pip module (see
Installing the module using pip) for installation.Installing the Package for WindowsThe installation is as easy as downloading the namemod-<version>.win-bin.zip package and extracting it to wherever directory the user needs it to be. Moreover, it is recommended to include the installation directory to the usersPATH environment variable.Installing the module using pipIf 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 installationC:\>python -m pip install namemodUsing the namemod commandName Modifier can be used as easy as the other command line (e.g. dir) known to the user. The main command in this package isnamemod. 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 pythonpython -m namemod [optional arguments] <folder> <old_name_segment> <new_name_segment>The -h or –help argumentNormally 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 argumentpython -m namemod –hThe output would be the one shown in Listing 1.Listing 1. -h argument outputusage: 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 exitFor more information about the usage, please download the user guide fromhttps://sourceforge.net/projects/namemodifier/files