Skip to main content

Batch Rename Program

The Batch Rename Program allows for renaming of multiple files from the command line.

Usage

usage: brp [-h] [-a [FILE ...]] filename [filename ...]

positional arguments:
  filename              list of files to rename

optional arguments:
  -h, --help            show this help message and exit
  -a [FILE ...], --auto [FILE ...]
                        automated file to run (default: None)

Operations

automate

Command: automate, a, auto
Usage: auto [filename ...]
Takes a file with commands on each line and run them in sequence.

Example file:

list
replace foo bar
insert "foo - " 0
write

Any commands that are missing arguments (like only passing in find and not replace to the replace command) will ask for manual user input. The -c command does not need to be passed if all other arguments are passed as well.

episodes

Command: episodes, e, ep
Usage: ep [filename ...]
Load file with one episode number and episode title per line. Episode sould match end of files being matched, accepted filename patterns:

Show name - {episode} -
Show name - {episode}

Multiple files can be specified to load names from.

Example files:

0101 Pilot
0102 Cool Episode
s01e01 Pilot
s02e02 Different show

extension

Command: extension, x, ext Usage: ext [new] [pattern] Change the file extensions of the files, a pattern can be provided to match against filename or current extension.

Examples:

filename.txt
> ext csv txt
filename.csv
> ext tsv txt
filename.csv

help

Command: help, h, ?
Usage: help
Print the help message to the console

insert

Command: insert, i
Usage: insert [value] [index] Insert given value at index (0 being the begining of the word). Negative values count from the end of the word. Numbers that are longer than the word get added to the end or beginning of the word (positive or negative value respectivly).

Examples:

filename.txt
> insert _ 4
file_name.txt
> insert s -1
file_names.txt
> insert _hello 100
file_names_hello.txt
> insert begin_ -100
begin_file_names_hello.txt

list

Command: list, l
Usage: list List all files and the current state of their changes

Example:

filename.txt
begin_file_names_hello.csv

other name.txt
begin_other_names_hello.tsv

quit

Command: quit, q
Usage: quit [-c|--confirm] Exit the program without saving any changes

replace

Command: replace, r, re
Usage: re [find] [replace] Find and replace given values in files that match

Examples:

filename.txt
other_file.txt
third file.txt
> re _ -
filename.txt
other-file.txt
third file.txt
> re "third " "first~"
filename.txt
other-file.txt
first~file.txt

save

Command: save, s
Usage: save [-c|--confirm] Rename files with their current changes

tracks

Command: tracks, t, tr
Usage: tr [filename ...]
Load file with one track number and track title per line. Example file:

01 Foo Song
02 Bar Song

Would make following changes:

Foo Song.mp3
01 Foo Song.mp3

Bar Song.flac
02 Bar Song.flac

undo

Command: undo, u
Usage: undo [number] Reverts last N changes (1 if none provided when asked). Trying to undo when no changes are present doesn't change anything. Examples:

filename.txt
> insert _ 4
file_name.txt
> re file song
song_name.txt
> ext txt csv
song_name.csv
> undo
song_name.txt
> undo 2
filename.txt
> undo
filename.txt

write

Command: write, w
Usage: write [-c|--confirm]
Rename files and exit program

Contributing

Help is greatly appreciated. First check if there are any issues open that relate to what you want to help with. Also feel free to make a pull request with changes / fixes you make.

License

MIT License

Metadata

Release files for batchrenamer 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batchrenamer 1.3.0
File Size Uploaded Provenance Actions
batchrenamer-1.3.0.tar.gz 10.4 kB Without provenance Details for batchrenamer-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for batchrenamer 1.3.0
File Interpreter ABI Platform Actions
batchrenamer-1.3.0-py3-none-any.whl Python 3 none any Details for batchrenamer-1.3.0-py3-none-any.whl

Total release size: 20.5 kB

Release files / batchrenamer-1.3.0.tar.gz

Download URL batchrenamer-1.3.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
700d616e687fffde0937ecd80dadb2166ac1563ac66306b66a1c8f3cd0a9e244
BLAKE2b-256 checksum
How to use checksums
8a6f0135c0ff37ae42fc5dca74fa37fe29a8a121733ad2d1095633e7c59761ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / batchrenamer-1.3.0-py3-none-any.whl

Download URL batchrenamer-1.3.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0f8da79de5a7f3d9353959ea022e3d980273dce213b18b7d6155de92871c5c4
BLAKE2b-256 checksum
How to use checksums
ab4fb71e0de7ad109925b791a0723eb8636d323d3c5a1f81fc93016ca84d501f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Security for batchrenamer 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page