About
renux is a tool with a text-based (terminal) user interface (TUI) that
automates file renaming. It simplifies this task with features like regex,
placeholders, and text transformations, making it ideal for situations such as
renaming photos, cleaning up download folders, or enforcing consistent naming
conventions.
Features
- Regex: perform advanced renaming with pattern matching, capturing groups, and replacements.
- Text transformations: apply text transformations like slugify, camelCase to snake_case, and more.
- Counter placeholders: add incremental counters (e.g., file1.txt, file2.txt) with customizable starting points, increments, and padding.
- Date placeholders: include file creation/modification dates or the current date in filenames with customizable formats.
- Backup and undo/redo: save and restore changes to your files.
- File exclusion: exclude files from renaming.
- Keyboard shortcuts: use hotkeys to quickly apply actions and navigate the UI.
Installation
Using pipx (recommended).
pipx install renux
Alternatively, you can use pip.
Usage
renux [directory] [pattern] [replacement]
Arguments
directory: Directory where files are located (default is the current directory or.).pattern: Search pattern, which can be a regular expression (default is '').replacement: Replacement string for the pattern (default is '').
Options
-c COUNT,--count COUNT: Max replacements per file (default is 0, meaning unlimited).-r,--regex: Treats the pattern as a regular expression (default is True).--case-sensitive: Makes the search case-sensitive (default is False).--apply-to: Specifies where the renaming should be applied. Options are:name: Rename the file's base name (default).ext: Rename the file's extension.both: Rename both the name and extension.
Markup
-
Text transformations:
{string|operation}slugify: Convert into a URL/filename-friendly format (e.g., "hello world" → "hello-world")lower: Convert to lowercaseupper: Convert to uppercasecaps: Capitalize the first lettertitle: Capitalize each wordcamel: Convert to camel case (e.g., "hello world" → "helloWorld")pascal: Convert to pascal case (e.g., "hello world" → "HelloWorld")snake: Convert to snake case (e.g., "hello world" → "hello_world")kebab: Convert to kebab case (e.g., "hello world" → "hello-world")swapcase: Swap the case (e.g., "Hello World" → "hELLO wORLD")reverse: Reverse the string (e.g., "Hello World" → "dlroW olleH")strip: Remove leading and trailing whitespacelen: Get the length of the string
-
Counter:
{counter(start=1,step=1,padding=1)}, e.g.,{counter(1,2,3)}will generate a sequence like001,003,005, ... -
Dates:
{now|created_at|modified_at(<format>)}, e.g.,{now(%Y)}will replace it with the current year
Run renux --help for more details.
Examples
- Rename files starting with "IMG" to "Image":
renux my_photos/ IMG_ Image_
- Rename all
.txtfiles to.bak:renux my_directory/ .txt .bak --apply-to ext
- Use regex to retain information from the old name:
renux my_documents "document (\d).pdf" "doc (\1).pdf" -r
- Append a counter to filenames:
renux my_files/ file "file_{counter}"
- Append creation year to filenames:
renux my_files/ file "file_{created_at(%Y)}"
- Apply transformations like slugify:
renux my_files "(.*)" "{filename|slugify}" -r
Dev Setup
- Clone the repo
git clone https://github.com/andrianllmm/renux.git cd renux
- Install dependencies with Poetry
poetry install
Testing
Run tests with pytest:
poetry run python -m pytest
Contributing
Contributions are welcome! See CONTRIBUTING.md for more details.
License
Distributed under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file renux-0.2.0.tar.gz.
File metadata
- Download URL: renux-0.2.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c88a5824283e0239163059f4df03938d399f2a03784243a8f1d7bef24bd6fb4
|
|
| MD5 |
7b5063f3056f42430cb7bd3796f7a945
|
|
| BLAKE2b-256 |
3f060ddbeac68570bc2b08a17726eccf9f2d238d03a1cb1819d4df3ea80d1efa
|
Provenance
The following attestation bundles were made for renux-0.2.0.tar.gz:
Publisher:
release.yml on andrianllmm/renux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
renux-0.2.0.tar.gz -
Subject digest:
2c88a5824283e0239163059f4df03938d399f2a03784243a8f1d7bef24bd6fb4 - Sigstore transparency entry: 2340035332
- Sigstore integration time:
-
Permalink:
andrianllmm/renux@8aedb30e264137549d8ec847103fc829dd42c2cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andrianllmm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8aedb30e264137549d8ec847103fc829dd42c2cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file renux-0.2.0-py3-none-any.whl.
File metadata
- Download URL: renux-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22b69295efd26a1559cef1bfa48e3d092d550e41addd605439dcb09af0f236e6
|
|
| MD5 |
000e97cb7dced1b96655f23a20868f9d
|
|
| BLAKE2b-256 |
c833fe56bdaa302b70ab14253ca168c4b032555c62569a68767acc9b14ec4464
|
Provenance
The following attestation bundles were made for renux-0.2.0-py3-none-any.whl:
Publisher:
release.yml on andrianllmm/renux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
renux-0.2.0-py3-none-any.whl -
Subject digest:
22b69295efd26a1559cef1bfa48e3d092d550e41addd605439dcb09af0f236e6 - Sigstore transparency entry: 2340035354
- Sigstore integration time:
-
Permalink:
andrianllmm/renux@8aedb30e264137549d8ec847103fc829dd42c2cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andrianllmm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8aedb30e264137549d8ec847103fc829dd42c2cc -
Trigger Event:
push
-
Statement type: