{"id":34028209,"url":"https://github.com/jet-logic/renx","last_synced_at":"2026-04-09T00:31:14.986Z","repository":{"id":291959503,"uuid":"979342062","full_name":"jet-logic/renx","owner":"jet-logic","description":"command-line utility for batch renaming files and directories with advanced pattern matching and transformation capabilities","archived":false,"fork":false,"pushed_at":"2025-09-11T21:58:09.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T07:26:22.656Z","etag":null,"topics":["command-line-tool","filesystem","python","regex","regular-expression","rename-files","unicode-characters"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jet-logic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T11:16:50.000Z","updated_at":"2025-09-11T19:47:08.000Z","dependencies_parsed_at":"2025-05-24T20:18:31.708Z","dependency_job_id":"f96a46f3-6e94-4032-b8c9-8732f4cd49f1","html_url":"https://github.com/jet-logic/renx","commit_stats":null,"previous_names":["jet-logic/renx"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jet-logic/renx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet-logic%2Frenx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet-logic%2Frenx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet-logic%2Frenx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet-logic%2Frenx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jet-logic","download_url":"https://codeload.github.com/jet-logic/renx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet-logic%2Frenx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","filesystem","python","regex","regular-expression","rename-files","unicode-characters"],"created_at":"2025-12-13T17:04:12.124Z","updated_at":"2026-04-09T00:31:14.973Z","avatar_url":"https://github.com/jet-logic.png","language":"Python","funding_links":["https://ko-fi.com/B0B01E8SY7"],"categories":[],"sub_categories":[],"readme":"`renx` is a powerful command-line utility for batch renaming files and directories with advanced pattern matching and transformation capabilities.\n\n\u003cimg src=\"logo.svg\" width=256\u003e\n\n[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![PyPI version fury.io](https://badge.fury.io/py/renx.svg)](https://pypi.python.org/pypi/renx/)\n[![Tests Status](https://github.com/jet-logic/renx/actions/workflows/build.yml/badge.svg)](https://github.com/jet-logic/renx/actions)\n\n## ☕ Support\n\nIf you find this project helpful, consider supporting me:\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B01E8SY7)\n\n## ✨ Features\n\n- **Pattern-based renaming** 🧩 - Use regex substitutions to transform filenames\n- **Case conversion**: lower, upper, title, swapcase, capitalize\n- **URL-safe names** 🌐 - Clean filenames for web use (`--urlsafe`)\n- **Precise file selection** 🎯:\n  - Include/exclude files with `--includes`/`--excludes`\n  - Control traversal depth with `--max-depth`\n- **Safe operations** 🛡️:\n  - Dry-run mode by default (`--act` to execute) preview changes before executing\n  - Bottom-up or top-down processing\n\n## 📦 Installation\n\n```bash\npip install renx\n```\n\n## 🚀 Usage\n\n```bash\npython -m renx [OPTIONS] [PATHS...]\n```\n\n### Basic Examples\n\n1. **Dry-run preview (default behavior)**:\n\n   ```bash\n   python -m renx /path/to/files\n   ```\n\n2. **Convert filenames to lowercase**:\n\n   ```bash\n   python -m renx --lower /path/to/files\n   ```\n\n3. **Actually perform renames (disable dry-run)**:\n\n   ```bash\n   python -m renx --act --lower /path/to/files\n   ```\n\n4. **Make filenames URL-safe**:\n   ```bash\n   python -m renx --urlsafe /path/to/files\n   ```\n\n## 🔁 Substitution Pattern Format\n\n### 1. Simple Transformation Syntax\n\n```\ntransform_name[:additional_flags]\n```\n\n- Applies a transformation to the entire input\n- No search-replace pattern matching\n- Example: `\"upper\"` or `\"lower:ext\"`\n\n### 2. Search-Replace Syntax\n\n```\n❗search❗replacement❗[flags]\n```\n\n- Performs pattern-based substitution\n- Example: `\"/old/new/\"` or `\"@pattern@replacement@i\"`\n- The first character (❗) after `-s` or `--subs` acts as the delimiter\n\n### Components\n\n#### Separators\n\n❗ Must be one of these special characters:\n\n```\n!\"#$%\u0026'*+,-./:;\u003c=\u003e?@\\^_`|~\n```\n\nFirst character of string defines the separator for the entire pattern.\n\n#### Transformation Names\n\nAvailable transformations (can be used in both syntax forms):\n\n| Name       | Description                           |\n| ---------- | ------------------------------------- |\n| upper      | Convert to uppercase                  |\n| lower      | Convert to lowercase                  |\n| title      | Title case                            |\n| swapcase   | Swap case of all letters              |\n| expandtabs | Replace tabs with spaces              |\n| casefold   | Aggressive lowercase for matching     |\n| capitalize | Capitalize first letter               |\n| asciify    | Convert to ASCII (custom function)    |\n| slugify    | Convert to URL slug (custom function) |\n| urlsafe    | Make URL-safe (custom function)       |\n\n#### Special Flags\n\nCan be appended after colons (`:`):\n\n| Flag | Description                   |\n| ---- | ----------------------------- |\n| ext  | Only apply to file extensions |\n| stem | Only apply to filename stems  |\n\n#### Regex Flags\n\nStandard Python regex flags can be included:\n\n- `i` - Case insensitive\n- `m` - Multiline mode\n- `s` - Dot matches all\n- etc. (any valid regex flag)\n\n#### Examples\n\nSimple Transformations\n\n- `\"upper\"` - Convert entire string to uppercase\n- `\"lower:ext\"` - Convert file extension to lowercase\n- `\"slugify:stem\"` - Convert filename stem to URL slug\n\nSearch-Replace Operations\n\n- `\"/old/new/\"` - Basic replacement\n- `\"@[0-9]+@NUM@i\"` - Replace all numbers with \"NUM\" (case insensitive)\n- `\"#cat#dog#ext\"` - Replace \"cat\" with \"dog\" only in file extensions\n- `\"!([A-Z])!\\1_!stem:lower\"` - Add underscore after capitals in stems and lowercase all\n\n### Usage Notes\n\n- When using the search-replace syntax, the first character must be from the separator set\n- Multiple flags can be combined with colons (`:`)\n- The \"ext\" and \"stem\" flags are mutually exclusive\n\n## Practical Examples\n\n- **Replace spaces with underscores**:\n\n  ```\n  renx -s '/ /_/' /path/to/files\n  ```\n\n- **Remove special characters**:\n\n  ```\n  renx -s '/[^a-zA-Z0-9.]//' /path/to/files\n  ```\n\n- **Add prefix to numbered files**:\n\n  ```\n  renx -s '/(\\d+)/image_\\1/' *.jpg\n  ```\n\n- **Fix inconsistent extensions (case-insensitive)**:\n  ```\n  renx -s '/\\.jpe?g$/.jpg/i' *\n  ```\n\n### Filtering Options\n\n1. **Process only matching files**:\n\n   ```bash\n   python -m renx --name '*.txt' --lower /path/to/files\n   ```\n\n2. **Exclude directories**:\n\n   ```bash\n   python -m renx --exclude 'temp/*' /path/to/files\n   ```\n\n3. **Limit recursion depth**:\n   ```bash\n   python -m renx --depth ..2 /path/to/files\n   ```\n\n## Multiple substitution\n\nWhen your downloaded files look like they were named by a cat walking on a keyboard 😉:\n\n```bash\npython -m renx --act \\\n    -s '#(?:(YTS(?:.?\\w+)|YIFY|GloDLS|RARBG|ExTrEmE|EZTVx.to|MeGusta|Lama))##ix' \\\n    -s '!(2160p|1080p|720p|x264|x265|HEVC|AAC|AC3)!!i' \\\n    -s '!(HDRip|BluRay|WEB-DL|DVDrip|BRrip|WEBRip|HDRip|DTS)!!i' \\\n    -s '!\\[(|\\w+)\\]!\\1!' \\\n    -s '/[\\._-]+/./' \\\n    -s '/\\.+/ /stem' \\\n    -s /.+//ext:lower \\\n    -s '/.+//stem:title' \\\n    --include \"*.m*\" \\\n    .\n# Before: \"the.matrix.[1999].1080p.[YTS.AM].BRRip.x264-[GloDLS].ExTrEmE.mKV\"\n# After: \"The Matrix 1999.mkv\" 🎬✨\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjet-logic%2Frenx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjet-logic%2Frenx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjet-logic%2Frenx/lists"}