Name | crenametoix JSON |
Version |
1.4.1
JSON |
| download |
home_page | None |
Summary | Linux file renamer featuring an advanced macro ecosystem |
upload_time | 2025-01-07 12:24:07 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
linux
rename
file
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Description
[RenameToIX](https://www.devtoix.com/en/projects/renametoix) is a visual Linux Gtk file renamer featuring an advanced macro ecosystem, seamlessly integrating with Nemo, Nautilus, and Thunar file managers.
For `crenametoix`, the console version without Gtk dependencies, read [here](https://www.devtoix.com/en/projects/renametoix#crenametoix)
Simple macro example:

Python lambda expression example:

Reverse Geocoding macro example:

Doc Header macro example:

Read section [Integrate](#integrate) on now to integrate with Nemo, Nautilus and Thunar.
If you find this project useful, please, read the [Support this Project](#support-this-project) on how to contribute.
## Features
- GUI and Console mode. (¹)
- **Single click macro**.
- Counter, file datetime, and extension Macros.
- Function Macros with regex group capture: `lower`, `upper`, `capitalize` and `title`.
- Python lambda expressions macro.
- Reverse geocoding of JPEG images from GPS information macro via [geo plugin](#geo-plugin).
- Header of Word documents macro via [doc plugin](#doc-plugin).
- Custom macro extensions using [plugins](#plugins).
- Start index for counter macro.
- Configurable list of macros.
- Revert previous renames (first activate on Settings dialog). (¹)
- Send notification after renames (first activate on Settings dialog). (¹)
- Integration with Nemo, Nautilus and Thunar File Manager. (¹)
- Limited support for [mtp devices](#mtp-devices) (Smartphones, Cameras, etc...). (¹)
- Translated into multiple languages *1*
(¹) - supported only on renametoix but not on [crenametoix](#crenametoix)
## Installation
```bash
sudo add-apt-repository ppa:a-bentofreire/toix
sudo apt-get update
sudo apt install renametoix
```
## crenametoix
**crenametoix** is a version of renametoix for console only without Gtk dependencies,
it supports all the features including plugins, except: translations, mtp devices, revert and notifications.
Configuration files aren't generated.
```bash
sudo add-apt-repository ppa:a-bentofreire/toix
sudo apt-get update
sudo apt install crenametoix
```
**crenametoix** can also be installed via pip
```bash
pip install crenametoix
```
## Requirements
RenameToIX uses `xdg-open` and `notify-send` external commands.
## Macros
- `%n, %0n ... %00000n` - counter
- `%B` - file basename (without extension)
- `%E` - file extension
- `%Y` - file 4-digit year
- `%m` - file 2-digit month
- `%d` - file 2-digit day
- `%H` - file 2-digit hour
- `%M` - file 2-digit minute
- `%S` - file 2-digit second
- `%0{upper}` `%0{u}` - uppercase (function)
- `%0{lower}` `%0{l}` - lowercase (function)
- `%0{capitalize}` `%0{c}` - capitalize (function)
- `%0{title}` `%0{t}` - capitalize (function)
- `%:{expr}` - evaluates [python lambda expressions](#python-lambda-expressions)
- `%!{geo:%country%, %city%}` - replaces with the "country", "city" from the JPEG image GPS info via [geo plugin](#geo-plugin)
- `%!{doc:%header%}` - replaces with the "header" with the first header in a doc file [doc plugin](#doc-plugin)
## Macro functions
The macro functions can also be used with regular expressions to capture groups.
ex1:
- Replace: `%0{title}`
- Filename: `my document.png` will become `My Document.png`
ex2:
- Find: `..(NEW).(design)`
- Replace: `%1{l}-%2{u}`
- Filename: `n-myNEW design.png` will become `n-new-DESIGN.png`
ex3:
- Find: ``
- Replace: `new-%B ready`
- Filename: `design.png` will become `new-design ready.png`
## Python Lambda Expressions
The `%:{expr}` will internally evaluate a lambda expression: `eval(f"lambda m: {expr}")(groups)`
where groups are:
- if regular expressions, then are the captured groups from a regular expression.
- otherwise, it's the text to find.
ex:
- Find: `^(.*)-(.*)$`
- Replace: `%:{m[2] - m[1]}`
- Regular Expression: `checked`.
- Filename: `code-actions.py` will become `Actions - Code.py`
### Features and Limitations
- The expression can't contain a closed curly bracket `}`.
- The evaluator doesn't do any security checks, so run it at your own risk.
## Plugins
The `%!{plugin_name:expr}` will call an external plugin to evaluate the expression.
- Plugins are python scripts located on `/usr/lib/renametoix/plugins`.
- A plugin must have a function named `get_worker()`, returning an instance of a class with the following methods:
- The expression can't contain a closed curly bracket `}`.
| Method | Description |
| -- | -- |
| `is_slow(self)` | returns `True` if the plugin requires slow operations |
| `get_extensions(self)` | returns a list of file extensions supported |
| `eval_expr(self, macro, filename, groups)` | evaluates a macro. It should be a fast operation |
| `prepare(self, files)` | for each file, it will prepare the macro evaluation<br>if `is_slow` is `True`, it will run in a working thread if it's GUI mode |
## Geo Plugin
Geo Plugin performs reverse geocoding.
- Requires install python packages: `pip install geopy piexif`.
- Supports the following geocoding fields: `country`, `state`, `city`, `postcode`, `suburb`.
- Supports `.jpg` and `.jpeg` file extensions.
- Ending spaces, commas and semi-commas are striped.
ex:
- Replace: `%!{geo:%country%, %city%}`
- Filename: `IMG_.jpg` will become `MyCountry, MyCity.jpg`
## Doc Plugin
Doc Plugin extracts the first header from a Word doc/docx file.
- Requires install python package: `pip install python-docx`.
- Supports the following geocoding fields: `header`.
- Supports `.doc` and `.docx` file extensions.
ex:
- Replace: `%!{doc:%header%}`
- Filename: `a.docx` will become `MyHeaderH1.docx`
## Running in console mode
To activate on console mode, use `--console` on command line:
```plaintext
usage: renametoix [-h] [-console] [-start-index START_INDEX] [-reg-ex] [-include-ext] [-find FIND] [-replace REPLACE] [-allow-revert] [-test-mode] [-revert-last] [files ...]
positional arguments:
files Source files
options:
-h, --help show this help message and exit
-console Console mode (¹)
-start-index START_INDEX
Start index used with there is a %0n macro
-reg-ex Uses regular expressions on the find field
-include-ext Renames including the file extension
-find FIND Text to Find
-replace REPLACE Text to Replace
-allow-revert Generates a revert file (console mode) (¹)
-test-mode Outputs only the new result, doesn't rename (console mode) (¹)
-revert-last Reverts last rename and exits (¹)
```
(¹) - supported only on renametoix but not on [crenametoix](#crenametoix)
## Revert the last rename in console mode
If the previous console mode rename was executed with `-allow-revert`, then:
`renametoix -revert-last` will revert the last rename.
## Integrate
RenameToIX can be integrated with Nemo, Nautilus and Thunar.
On RenameToIX application, click on the Settings button, and then `Integrate` button.
- Nemo Bulk Rename: When you press F2 it will use **RenameToIX** instead of bulky.
- Nemo Action: On context menu, it will include an item named **RenameToIX**.
- Nautilus Script: On context menu Scripts, it will include an item named **RenameToIX**.
- Thunar Action: On context menu, it will include an item named **RenameToIX**.
## Languages
- English
- Portuguese
- Spanish
- German
- Russian
- Ukrainian
## Mtp Devices
RenameToIX can rename files on mtp devices with the following limitations:
- It doesn't support revert.
- The file is copied and the deleted the original, this is a slow operation and doesn't preserves the timestamp.
- When modifying the Find Replace fields, it's checking if the new filename exists on the destination. This is a slow operation.
## Translations
To improve translations:
- Clone the project from [Github](https://github.com/a-bentofreire).
- Update the translation on `tools/l10n.po`.
- Run `convert-l10n.sh`.
## Support this Project
If you find this project useful, consider supporting it:
- Donate:
[](https://www.paypal.com/donate/?business=MCZDHYSK6TCKJ&no_recurring=0&item_name=Support+Open+Source¤cy_code=EUR)
[](https://buymeacoffee.com/abentofreire)
- Visit the project [homepage](https://www.devtoix.com/en/projects/renametoix)
- Give the project a ⭐ on [Github](https://github.com/a-bentofreire/renametoix)
- [Translate into your language](#translations)
- Spread the word
- Follow me:
- [Github](https://github.com/a-bentofreire)
- [LinkedIn](https://www.linkedin.com/in/abentofreire)
- [Twitter/X](https://x.com/devtoix)
## License
GPLv3 License
## Contributions
- [claimsecond](https://github.com/claimsecond) - Translations in Russian and Ukrainian
## Copyrights
(c) 2024-2025 [Alexandre Bento Freire](https://www.a-bentofreire.com)
Raw data
{
"_id": null,
"home_page": null,
"name": "crenametoix",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "linux, rename, file",
"author": null,
"author_email": "Alexandre Bento Freire <devtoix@a-bentofreire.com>",
"download_url": "https://files.pythonhosted.org/packages/77/e7/99ef1799fc6d49ae493a89fb132c31d4e6c541928e1a61585b42956345f5/crenametoix-1.4.1.tar.gz",
"platform": null,
"description": "# Description\n\n[RenameToIX](https://www.devtoix.com/en/projects/renametoix) is a visual Linux Gtk file renamer featuring an advanced macro ecosystem, seamlessly integrating with Nemo, Nautilus, and Thunar file managers.\n\nFor `crenametoix`, the console version without Gtk dependencies, read [here](https://www.devtoix.com/en/projects/renametoix#crenametoix)\n\nSimple macro example:\n\n\n\nPython lambda expression example:\n\n\n\nReverse Geocoding macro example:\n\n\n\nDoc Header macro example:\n\n\n\nRead section [Integrate](#integrate) on now to integrate with Nemo, Nautilus and Thunar.\n\nIf you find this project useful, please, read the [Support this Project](#support-this-project) on how to contribute. \n\n## Features\n\n- GUI and Console mode. (\u00b9)\n- **Single click macro**.\n- Counter, file datetime, and extension Macros.\n- Function Macros with regex group capture: `lower`, `upper`, `capitalize` and `title`.\n- Python lambda expressions macro.\n- Reverse geocoding of JPEG images from GPS information macro via [geo plugin](#geo-plugin).\n- Header of Word documents macro via [doc plugin](#doc-plugin).\n- Custom macro extensions using [plugins](#plugins).\n- Start index for counter macro.\n- Configurable list of macros.\n\n- Revert previous renames (first activate on Settings dialog). (\u00b9)\n- Send notification after renames (first activate on Settings dialog). (\u00b9)\n- Integration with Nemo, Nautilus and Thunar File Manager. (\u00b9)\n- Limited support for [mtp devices](#mtp-devices) (Smartphones, Cameras, etc...). (\u00b9)\n- Translated into multiple languages *1*\n\n(\u00b9) - supported only on renametoix but not on [crenametoix](#crenametoix)\n\n## Installation\n\n```bash\nsudo add-apt-repository ppa:a-bentofreire/toix\nsudo apt-get update\nsudo apt install renametoix\n```\n\n## crenametoix\n\n**crenametoix** is a version of renametoix for console only without Gtk dependencies,\nit supports all the features including plugins, except: translations, mtp devices, revert and notifications. \nConfiguration files aren't generated.\n\n```bash\nsudo add-apt-repository ppa:a-bentofreire/toix\nsudo apt-get update\nsudo apt install crenametoix\n```\n\n**crenametoix** can also be installed via pip\n\n```bash\npip install crenametoix\n```\n\n## Requirements\n\nRenameToIX uses `xdg-open` and `notify-send` external commands.\n\n## Macros\n\n- `%n, %0n ... %00000n` - counter\n- `%B` - file basename (without extension)\n- `%E` - file extension\n- `%Y` - file 4-digit year\n- `%m` - file 2-digit month\n- `%d` - file 2-digit day\n- `%H` - file 2-digit hour\n- `%M` - file 2-digit minute\n- `%S` - file 2-digit second\n- `%0{upper}` `%0{u}` - uppercase (function)\n- `%0{lower}` `%0{l}` - lowercase (function)\n- `%0{capitalize}` `%0{c}` - capitalize (function)\n- `%0{title}` `%0{t}` - capitalize (function)\n- `%:{expr}` - evaluates [python lambda expressions](#python-lambda-expressions)\n- `%!{geo:%country%, %city%}` - replaces with the \"country\", \"city\" from the JPEG image GPS info via [geo plugin](#geo-plugin)\n- `%!{doc:%header%}` - replaces with the \"header\" with the first header in a doc file [doc plugin](#doc-plugin)\n\n## Macro functions\n\nThe macro functions can also be used with regular expressions to capture groups.\n\nex1:\n- Replace: `%0{title}`\n- Filename: `my document.png` will become `My Document.png`\n\nex2:\n- Find: `..(NEW).(design)`\n- Replace: `%1{l}-%2{u}`\n- Filename: `n-myNEW design.png` will become `n-new-DESIGN.png`\n\nex3:\n- Find: ``\n- Replace: `new-%B ready`\n- Filename: `design.png` will become `new-design ready.png`\n\n## Python Lambda Expressions\n\nThe `%:{expr}` will internally evaluate a lambda expression: `eval(f\"lambda m: {expr}\")(groups)`\n\nwhere groups are:\n- if regular expressions, then are the captured groups from a regular expression.\n- otherwise, it's the text to find.\n\nex:\n- Find: `^(.*)-(.*)$`\n- Replace: `%:{m[2] - m[1]}`\n- Regular Expression: `checked`.\n- Filename: `code-actions.py` will become `Actions - Code.py`\n\n### Features and Limitations\n\n- The expression can't contain a closed curly bracket `}`.\n- The evaluator doesn't do any security checks, so run it at your own risk.\n\n## Plugins\n\nThe `%!{plugin_name:expr}` will call an external plugin to evaluate the expression. \n\n- Plugins are python scripts located on `/usr/lib/renametoix/plugins`.\n- A plugin must have a function named `get_worker()`, returning an instance of a class with the following methods:\n- The expression can't contain a closed curly bracket `}`.\n\n| Method | Description |\n| -- | -- |\n| `is_slow(self)` | returns `True` if the plugin requires slow operations |\n| `get_extensions(self)` | returns a list of file extensions supported |\n| `eval_expr(self, macro, filename, groups)` | evaluates a macro. It should be a fast operation |\n| `prepare(self, files)` | for each file, it will prepare the macro evaluation<br>if `is_slow` is `True`, it will run in a working thread if it's GUI mode |\n\n## Geo Plugin\n\nGeo Plugin performs reverse geocoding.\n\n- Requires install python packages: `pip install geopy piexif`.\n- Supports the following geocoding fields: `country`, `state`, `city`, `postcode`, `suburb`.\n- Supports `.jpg` and `.jpeg` file extensions.\n- Ending spaces, commas and semi-commas are striped.\n\nex:\n- Replace: `%!{geo:%country%, %city%}`\n- Filename: `IMG_.jpg` will become `MyCountry, MyCity.jpg`\n\n## Doc Plugin\n\nDoc Plugin extracts the first header from a Word doc/docx file.\n\n- Requires install python package: `pip install python-docx`.\n- Supports the following geocoding fields: `header`.\n- Supports `.doc` and `.docx` file extensions.\n\nex:\n- Replace: `%!{doc:%header%}`\n- Filename: `a.docx` will become `MyHeaderH1.docx`\n\n## Running in console mode\n\nTo activate on console mode, use `--console` on command line:\n\n```plaintext\nusage: renametoix [-h] [-console] [-start-index START_INDEX] [-reg-ex] [-include-ext] [-find FIND] [-replace REPLACE] [-allow-revert] [-test-mode] [-revert-last] [files ...]\n\npositional arguments:\n files Source files\n\noptions:\n -h, --help show this help message and exit\n -console Console mode (\u00b9)\n -start-index START_INDEX\n Start index used with there is a %0n macro\n -reg-ex Uses regular expressions on the find field\n -include-ext Renames including the file extension\n -find FIND Text to Find\n -replace REPLACE Text to Replace\n -allow-revert Generates a revert file (console mode) (\u00b9)\n -test-mode Outputs only the new result, doesn't rename (console mode) (\u00b9)\n -revert-last Reverts last rename and exits (\u00b9)\n```\n\n(\u00b9) - supported only on renametoix but not on [crenametoix](#crenametoix)\n\n## Revert the last rename in console mode\n\nIf the previous console mode rename was executed with `-allow-revert`, then: \n`renametoix -revert-last` will revert the last rename.\n\n## Integrate\n\nRenameToIX can be integrated with Nemo, Nautilus and Thunar.\nOn RenameToIX application, click on the Settings button, and then `Integrate` button.\n\n- Nemo Bulk Rename: When you press F2 it will use **RenameToIX** instead of bulky.\n- Nemo Action: On context menu, it will include an item named **RenameToIX**.\n- Nautilus Script: On context menu Scripts, it will include an item named **RenameToIX**.\n- Thunar Action: On context menu, it will include an item named **RenameToIX**.\n\n## Languages\n\n- English\n- Portuguese\n- Spanish\n- German\n- Russian\n- Ukrainian\n\n## Mtp Devices\n\nRenameToIX can rename files on mtp devices with the following limitations:\n- It doesn't support revert.\n- The file is copied and the deleted the original, this is a slow operation and doesn't preserves the timestamp.\n- When modifying the Find Replace fields, it's checking if the new filename exists on the destination. This is a slow operation.\n\n## Translations\n\nTo improve translations:\n- Clone the project from [Github](https://github.com/a-bentofreire).\n- Update the translation on `tools/l10n.po`.\n- Run `convert-l10n.sh`.\n\n## Support this Project\n\nIf you find this project useful, consider supporting it:\n\n- Donate: \n\n[](https://www.paypal.com/donate/?business=MCZDHYSK6TCKJ&no_recurring=0&item_name=Support+Open+Source¤cy_code=EUR)\n\n[](https://buymeacoffee.com/abentofreire)\n\n- Visit the project [homepage](https://www.devtoix.com/en/projects/renametoix)\n- Give the project a \u2b50 on [Github](https://github.com/a-bentofreire/renametoix)\n- [Translate into your language](#translations)\n- Spread the word\n- Follow me:\n - [Github](https://github.com/a-bentofreire)\n - [LinkedIn](https://www.linkedin.com/in/abentofreire)\n - [Twitter/X](https://x.com/devtoix)\n\n## License\n\nGPLv3 License\n\n## Contributions\n\n- [claimsecond](https://github.com/claimsecond) - Translations in Russian and Ukrainian\n\n## Copyrights\n\n(c) 2024-2025 [Alexandre Bento Freire](https://www.a-bentofreire.com)\n",
"bugtrack_url": null,
"license": null,
"summary": "Linux file renamer featuring an advanced macro ecosystem",
"version": "1.4.1",
"project_urls": {
"Changelog": "https://github.com/a-bentofreire/renametoix/blob/HEAD/CHANGELOG.md",
"Homepage": "https://www.devtoix.com/en/projects/renametoix",
"Issues": "https://github.com/a-bentofreire/renametoix/issues",
"Repository": "https://github.com/a-bentofreire/renametoix",
"Twitter": "https://x.com/devtoix"
},
"split_keywords": [
"linux",
" rename",
" file"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "81c6ebc0aced00597ebe3854bd71c4ad0c3728b88bd37f7010b0a122c80f6950",
"md5": "fbebb74d1e94dd4e96cd2ec3d61450a6",
"sha256": "3cdcf86026d2dfb36a78343821728cf94f25fa7d831d077a8d6632afd29ba55b"
},
"downloads": -1,
"filename": "crenametoix-1.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fbebb74d1e94dd4e96cd2ec3d61450a6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 10862,
"upload_time": "2025-01-07T12:24:06",
"upload_time_iso_8601": "2025-01-07T12:24:06.266239Z",
"url": "https://files.pythonhosted.org/packages/81/c6/ebc0aced00597ebe3854bd71c4ad0c3728b88bd37f7010b0a122c80f6950/crenametoix-1.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "77e799ef1799fc6d49ae493a89fb132c31d4e6c541928e1a61585b42956345f5",
"md5": "db103eddfbcb69a468a854d8976a5f61",
"sha256": "83ad75f3e8ec326ad3672739e170f54ba103d7c222871819f849eedc23ee3f9c"
},
"downloads": -1,
"filename": "crenametoix-1.4.1.tar.gz",
"has_sig": false,
"md5_digest": "db103eddfbcb69a468a854d8976a5f61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 13157,
"upload_time": "2025-01-07T12:24:07",
"upload_time_iso_8601": "2025-01-07T12:24:07.757366Z",
"url": "https://files.pythonhosted.org/packages/77/e7/99ef1799fc6d49ae493a89fb132c31d4e6c541928e1a61585b42956345f5/crenametoix-1.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-07 12:24:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "a-bentofreire",
"github_project": "renametoix",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "crenametoix"
}