Skip to main content

CLI tool written in Python 3 used to systemically rename files in a directory while adhering to a variety of criteria.

Project description

Renamer

CLI tool written in Python 3 used to systemically rename files in a directory while adhering to a variety of criteria.

This program attempts to emulate the simplicity of the CLI program FFmpeg but for renaming files. Basic operations are straight-forward, while complex operations only invovle adding more flags and parameters to your operation. A directory with files that contain some numerical pattern are all that's required to get started. The application is well-paired for other software that require strict naming schemes, such as Plex, Kodi, or image managers.

Installation

OS X & Linux:

bin/core.sh

Windows:

"bin/renamer.bat"

Usage

Operation Flag Flag(Formal) Parameter(s) Example Description
Shift -s --shift Number Shift (int) --shift -1 Shifts all numerical values by the specified offset
Zeroes -z --zeroes Leading Zeroes [int] -z 3 Prepends numerical values with the specified or inferred number of leading zeroes
Format -f --fmt Output Format (str) -f "Episode $d" Customizes filename output (see wiki for usage)
Extension -e --ext File Extension (str) --ext png Changes the extension of all files to the specified extension
Random -n --random Random Seed [int] -n 839693 Shuffles numerical values using the specified seed, or randomly
Consecutive -c --consecutive Flattens numerical values such that they are all consecutive
Mute -m --mute Squelches the console output of filenames and their renamed filename
Confirm -y --yes Confirms the operation and makes changes to your file system according to the parameters

Usage Examples

The following usage snippets use this directory as a template:

mydir/
  2021vacation0001.jpeg
  2021vacation0003.jpeg
  2021vacation0004.jpeg
  2021vacation0010.jpeg

Clean-up

e.g. 1.jpeg, 3.jpeg, 4.jpeg, 10.jpeg

core mydir

Formalize & Fix Ordering

01.jpeg, 02.jpeg, 03.jpeg, 04.jpeg

core mydir -z 1 -c

Format & Modify Extension

2021 Vacation - 1.png, 2021 Vacation - 3.png, 2021 Vacation - 4.png, 2021 Vacation - 10.png

core mydir -e png -f "2021 Vacation - $d"

Shift & Flatten

4.jpeg, 5.jpeg, 6.jpeg, 7.jpeg

core mydir -s 3 -c

Meta

Kevin Tyrrell – KevinTearUl@gmail.com

Distributed under the GPL3 license. See LICENSE for more information.

https://github.com/KevinTyrrell

Contributing

  1. Fork it (https://github.com/KevinTyrrell/Renamer)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

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

renamer_kt-1.0.0.tar.gz (25.4 kB view details)

Uploaded Source

File details

Details for the file renamer_kt-1.0.0.tar.gz.

File metadata

  • Download URL: renamer_kt-1.0.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for renamer_kt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2ffa5d163149c5a36feea23f1ab44afd47648fd3f130f291960e38580bcf3253
MD5 0f8fa2a1caec7385fdbf2053f5f64951
BLAKE2b-256 494ab00574e440a43537c439f374af8cb66a587b2f736f83495a8ca47f37ce9a

See more details on using hashes here.

Supported by

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