Name | renpy JSON |
Version |
0.9.7
JSON |
| download |
home_page | None |
Summary | RenPy is a Python CLI tool for renaming files efficiently. |
upload_time | 2025-02-15 07:12:55 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2024 Farhan Madni
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
renamer
cli
auto
automation
automatic
python
opensource
|
VCS |
 |
bugtrack_url |
|
requirements |
pyfiglet
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# **RenPy: CLI & Library for Auto Renaming** ๐
RenPy is a **Python library and CLI tool** designed to **automate file renaming** in a given directory. It sequentially renames files using a specified **base name**, appending a numeric index while preserving the original file extension.
## **๐ Features**
| Feature | Availability | Description |
| ------------------- | ------------ | ----------------------------------------------------------------------------- |
| **Batch Rename** | โ | Rename multiple files at once with a custom prefix. |
| **Sorting Options** | โ | Rename files in alphabetical, newest, or oldest order. |
| **Simulation Mode** | โ | Preview renaming changes without modifying files. No actual changes are made. |
| **Library Support** | โ | Use RenPy as a module in your Python scripts for automation. |
| **Cross-Platform** | โ | Works seamlessly on Windows, macOS, and Linux. |
## **๐ ๏ธ Prerequisites**
- **Python 3.x** installed
- Basic knowledge of **command-line usage**
### **๐ฆ Required Python Packages**
RenPy requires the following package(s):
- `pyfiglet` (for CLI banner text)
To install dependencies, run:
```sh
pip install -r requirements.txt # Use pip3 on macOS
```
## **โก Installation**
### **๐น Install via Pip**
To install RenPy as a library:
```sh
pip install renpy
```
### **๐น Install from Source**
To install and run the tool from the source code:
```sh
(git clone https://github.com/MFM-347/Ren.py.git
cd Ren.py
pip install .
```
## **๐ป CLI Usage**
### **๐ Run the CLI**
```sh
renpy <base_name> <directory> [-r <order>] [-s]
```
### **Example**
Rename files inside `C:\Users\YourName\Documents\Folder`, using "File" as the base name:
```sh
renpy "File" C:\Users\YourName\Documents\Folder
```
### **๐ Given Directory (`C:\Docs`)**
```
report.docx
notes.txt
summary.pdf
```
### **๐ท๏ธ Renaming Command**
```sh
renpy "Document" C:\Docs -r alphabet
```
### **๐ Output**
```
Document-1.docx
Document-2.pdf
Document-3.txt
```
## **โ๏ธ Command-Line Options**
| Option | Description |
| --------------------- | -------------------------------------------- |
| `<base_name>` | Prefix for renamed files. |
| `<directory>` | Path to folder containing the files. |
| `-r, --order <order>` | Sorting order before renaming: |
| | - `alphabet` โ A-Z order |
| | - `new` โ Newest to oldest |
| | - `old` โ Oldest to newest (default) |
| `-s, --simulate` | Run a **simulation** without renaming files. |
| `--case-sensitive` | Sorts filenames in case-sensitive mode. |
| `--debug` | Enables debug logging. |
## **๐ฆ Using RenPy as a Library**
### **๐น Installed Library Usage**
If you have installed RenPy via `pip`, you can use it in your Python scripts as follows:
```python
from renpy import renFn
from pathlib import Path
directory = Path("C:/Users/YourName/Documents/Folder")
renFn(base_name="Document", directory=directory, order="alphabet", simulate=False, case_sensitive=False)
```
### **๐น Source Code Usage**
If running directly from the cloned source repository:
```python
from renpy import renFn
from pathlib import Path
directory = Path("C:/Users/YourName/Documents/Folder")
renFn(base_name="Document", directory=directory, order="alphabet", simulate=False, case_sensitive=False)
```
### **Sorting Files Only**
If you only need to **get sorted files** without renaming:
```python
from renpy import sortFn
from pathlib import Path
directory = Path("/path/to/files")
sorted_files = sortFn(directory, order="new", case_sensitive=True)
print(sorted_files)
```
### **Handling Errors Gracefully**
You can wrap it in a try-except block:
```python
try:
renFn("Example", Path("/home/user/files"), "old", False, False)
except Exception as e:
print(f"An error occurred: {e}")
```
## **๐งช Running Tests (For Source Code Only)**
Run all tests:
```sh
python -m unittest discover tests
```
## Future Plans
- Add option to rename only specific file type.
- Add Graphic User Interface (GUI).
## **๐ค Contributing**
We welcome contributions! Please check the [CONTRIBUTING.md](https://github.com/MFM-347/Ren.py/blob/main/CONTRIBUTING.md) for guidelines.
## **๐จโ๐ป Credits**
Created and maintained by [MFM-347](https://github.com/MFM-347).
## **๐ License**
This project is licensed under the **MIT License**.
[](https://github.com/MFM-347/Ren.py/LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "renpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "renamer, cli, auto, automation, automatic, python, opensource",
"author": null,
"author_email": "Farhan Madni <madnifm347@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/b4/15/c4b8e90aff4c716a2bff238b4ccd074fe6daddd15b51af5419a3d439ed2c/renpy-0.9.7.tar.gz",
"platform": null,
"description": "# **RenPy: CLI & Library for Auto Renaming** \ud83d\ude80\r\n\r\nRenPy is a **Python library and CLI tool** designed to **automate file renaming** in a given directory. It sequentially renames files using a specified **base name**, appending a numeric index while preserving the original file extension.\r\n\r\n## **\ud83d\udccc Features**\r\n\r\n| Feature | Availability | Description |\r\n| ------------------- | ------------ | ----------------------------------------------------------------------------- |\r\n| **Batch Rename** | \u2714 | Rename multiple files at once with a custom prefix. |\r\n| **Sorting Options** | \u2714 | Rename files in alphabetical, newest, or oldest order. |\r\n| **Simulation Mode** | \u2714 | Preview renaming changes without modifying files. No actual changes are made. |\r\n| **Library Support** | \u2714 | Use RenPy as a module in your Python scripts for automation. |\r\n| **Cross-Platform** | \u2714 | Works seamlessly on Windows, macOS, and Linux. |\r\n\r\n## **\ud83d\udee0\ufe0f Prerequisites**\r\n\r\n- **Python 3.x** installed\r\n- Basic knowledge of **command-line usage**\r\n\r\n### **\ud83d\udce6 Required Python Packages**\r\n\r\nRenPy requires the following package(s):\r\n\r\n- `pyfiglet` (for CLI banner text)\r\n\r\nTo install dependencies, run:\r\n\r\n```sh\r\npip install -r requirements.txt # Use pip3 on macOS\r\n```\r\n\r\n## **\u26a1 Installation**\r\n\r\n### **\ud83d\udd39 Install via Pip**\r\n\r\nTo install RenPy as a library:\r\n\r\n```sh\r\npip install renpy\r\n```\r\n\r\n### **\ud83d\udd39 Install from Source**\r\n\r\nTo install and run the tool from the source code:\r\n\r\n```sh\r\n(git clone https://github.com/MFM-347/Ren.py.git\r\ncd Ren.py\r\npip install .\r\n```\r\n\r\n## **\ud83d\udcbb CLI Usage**\r\n\r\n### **\ud83d\udccc Run the CLI**\r\n\r\n```sh\r\nrenpy <base_name> <directory> [-r <order>] [-s]\r\n```\r\n\r\n### **Example**\r\n\r\nRename files inside `C:\\Users\\YourName\\Documents\\Folder`, using \"File\" as the base name:\r\n\r\n```sh\r\nrenpy \"File\" C:\\Users\\YourName\\Documents\\Folder\r\n```\r\n\r\n### **\ud83d\udcc2 Given Directory (`C:\\Docs`)**\r\n\r\n```\r\nreport.docx\r\nnotes.txt\r\nsummary.pdf\r\n```\r\n\r\n### **\ud83c\udff7\ufe0f Renaming Command**\r\n\r\n```sh\r\nrenpy \"Document\" C:\\Docs -r alphabet\r\n```\r\n\r\n### **\ud83d\udcdd Output**\r\n\r\n```\r\nDocument-1.docx\r\nDocument-2.pdf\r\nDocument-3.txt\r\n```\r\n\r\n## **\u2699\ufe0f Command-Line Options**\r\n\r\n| Option | Description |\r\n| --------------------- | -------------------------------------------- |\r\n| `<base_name>` | Prefix for renamed files. |\r\n| `<directory>` | Path to folder containing the files. |\r\n| `-r, --order <order>` | Sorting order before renaming: |\r\n| | - `alphabet` \u2192 A-Z order |\r\n| | - `new` \u2192 Newest to oldest |\r\n| | - `old` \u2192 Oldest to newest (default) |\r\n| `-s, --simulate` | Run a **simulation** without renaming files. |\r\n| `--case-sensitive` | Sorts filenames in case-sensitive mode. |\r\n| `--debug` | Enables debug logging. |\r\n\r\n## **\ud83d\udce6 Using RenPy as a Library**\r\n\r\n### **\ud83d\udd39 Installed Library Usage**\r\n\r\nIf you have installed RenPy via `pip`, you can use it in your Python scripts as follows:\r\n\r\n```python\r\nfrom renpy import renFn\r\nfrom pathlib import Path\r\n\r\ndirectory = Path(\"C:/Users/YourName/Documents/Folder\")\r\nrenFn(base_name=\"Document\", directory=directory, order=\"alphabet\", simulate=False, case_sensitive=False)\r\n```\r\n\r\n### **\ud83d\udd39 Source Code Usage**\r\n\r\nIf running directly from the cloned source repository:\r\n\r\n```python\r\nfrom renpy import renFn\r\nfrom pathlib import Path\r\n\r\ndirectory = Path(\"C:/Users/YourName/Documents/Folder\")\r\nrenFn(base_name=\"Document\", directory=directory, order=\"alphabet\", simulate=False, case_sensitive=False)\r\n```\r\n\r\n### **Sorting Files Only**\r\n\r\nIf you only need to **get sorted files** without renaming:\r\n\r\n```python\r\nfrom renpy import sortFn\r\nfrom pathlib import Path\r\n\r\ndirectory = Path(\"/path/to/files\")\r\nsorted_files = sortFn(directory, order=\"new\", case_sensitive=True)\r\nprint(sorted_files)\r\n```\r\n\r\n### **Handling Errors Gracefully**\r\n\r\nYou can wrap it in a try-except block:\r\n\r\n```python\r\ntry:\r\n renFn(\"Example\", Path(\"/home/user/files\"), \"old\", False, False)\r\nexcept Exception as e:\r\n print(f\"An error occurred: {e}\")\r\n```\r\n\r\n## **\ud83e\uddea Running Tests (For Source Code Only)**\r\n\r\nRun all tests:\r\n\r\n```sh\r\npython -m unittest discover tests\r\n```\r\n\r\n## Future Plans\r\n\r\n- Add option to rename only specific file type.\r\n- Add Graphic User Interface (GUI).\r\n\r\n## **\ud83e\udd1d Contributing**\r\n\r\nWe welcome contributions! Please check the [CONTRIBUTING.md](https://github.com/MFM-347/Ren.py/blob/main/CONTRIBUTING.md) for guidelines.\r\n\r\n## **\ud83d\udc68\u200d\ud83d\udcbb Credits**\r\n\r\nCreated and maintained by [MFM-347](https://github.com/MFM-347).\r\n\r\n## **\ud83d\udcdc License**\r\n\r\nThis project is licensed under the **MIT License**.\r\n\r\n[](https://github.com/MFM-347/Ren.py/LICENSE)\r\n",
"bugtrack_url": null,
"license": "MIT License\r\n \r\n Copyright (c) 2024 Farhan Madni\r\n \r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n \r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n \r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.",
"summary": "RenPy is a Python CLI tool for renaming files efficiently.",
"version": "0.9.7",
"project_urls": {
"Homepage": "https://github.com/MFM-347/Ren.py"
},
"split_keywords": [
"renamer",
" cli",
" auto",
" automation",
" automatic",
" python",
" opensource"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ba6db626df269f573b4e8c98887b917dfae72901b8a1dd80ae47cb0f33a7ea22",
"md5": "0963010a638329192f6a43a728765e67",
"sha256": "db6aea2d2c08502441a196f44a7bac84992b5c426c0ed7a36a4ec2baa898fc5c"
},
"downloads": -1,
"filename": "renpy-0.9.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0963010a638329192f6a43a728765e67",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6700,
"upload_time": "2025-02-15T07:12:52",
"upload_time_iso_8601": "2025-02-15T07:12:52.984726Z",
"url": "https://files.pythonhosted.org/packages/ba/6d/b626df269f573b4e8c98887b917dfae72901b8a1dd80ae47cb0f33a7ea22/renpy-0.9.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b415c4b8e90aff4c716a2bff238b4ccd074fe6daddd15b51af5419a3d439ed2c",
"md5": "53182dce6c3c17e6449687623bc79c88",
"sha256": "d68a4ebeaebeeb059ee3040b1106b0dcd2f15e7980487b6a92915a7cac244f8d"
},
"downloads": -1,
"filename": "renpy-0.9.7.tar.gz",
"has_sig": false,
"md5_digest": "53182dce6c3c17e6449687623bc79c88",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6161,
"upload_time": "2025-02-15T07:12:55",
"upload_time_iso_8601": "2025-02-15T07:12:55.176687Z",
"url": "https://files.pythonhosted.org/packages/b4/15/c4b8e90aff4c716a2bff238b4ccd074fe6daddd15b51af5419a3d439ed2c/renpy-0.9.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-15 07:12:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MFM-347",
"github_project": "Ren.py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pyfiglet",
"specs": []
}
],
"lcname": "renpy"
}