Skip to content

This is a CLI application to blindly rename files in a folder retaining the ability to restore the original names.

Notifications You must be signed in to change notification settings

IgorBonaP/blindrenamer

Repository files navigation

BLINDRENAMER

Python version: 3.7.0

This is both a CLI application and a python module for blindly renaming files of a given extension in a directory retaining the ability to revert the renaming operation. Currently, it can only rename files of one given extension at a time retaining the names relation of the last renaming operation run on the directory.

Usage

As a python module

Simply import the renaming methods from the blindrenamer package Methods are documented with doc strings. Main renaming mathods are blindrename and serialrename.

from blindrenamer import renamingmethods

pathtofiles = "some/path/to/files"
ext = ".someextension"
result = renamingmethods.blindrename(pathtofiles, ext)

for oldname, newname in result.items():
    print("{oldname} was renamed to {newname}".format(oldname=oldname, newname=newname))

revertresult = renamingmethods.undolastrename(pathtofiles)

for name in revertresult["success"]:
    print("{name} was sucessfully reverted to its original name.".format(name=name))

As a CLI application (currently only supporting blindrenaming, will add serialrename in the future)

With an user-interface

Run main.py in python interpreter or main.exe and follow the instructions in the prompt.

Headless

Set the configs in a .ini file following the example below:

[ALL]
directory = path/to/files
ext = .targetextension
save = True # If you want to be able to revert the rename operation set it to True.

In the command prompt run main.py with the python interpreter or main.exe with the -ini argument containing the path to the mentioned .ini file.

C:\blindrenamer>main -ini "path/to/inifile"

About

This is a CLI application to blindly rename files in a folder retaining the ability to restore the original names.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages