**Deprecated**: This package is no longer maintained. Please install ['rencli'](https://pypi.org/project/rencli/) instead.
# **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/f0/ee/351d43c9c6ca0ec65aeb9280c3f4a49a307a231e8a0a1a50c19c3740f474/renpy-0.9.8.tar.gz",
"platform": null,
"description": "**Deprecated**: This package is no longer maintained. Please install ['rencli'](https://pypi.org/project/rencli/) instead.\r\n\r\n# **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": null,
"summary": "DEPRECATED: Please use 'rencli'. This package is no longer maintained.",
"version": "0.9.8",
"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": "7c7a56673a28236fa2a200b9b6eb3b8483f305eadb4def8c6fffd8a000211357",
"md5": "d766f4718937173313685953a89c1091",
"sha256": "49d0eeec433283def82164bf4a130c8f7f37a20c36b21add63b78358093d4599"
},
"downloads": -1,
"filename": "renpy-0.9.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d766f4718937173313685953a89c1091",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6277,
"upload_time": "2025-08-26T05:30:58",
"upload_time_iso_8601": "2025-08-26T05:30:58.794120Z",
"url": "https://files.pythonhosted.org/packages/7c/7a/56673a28236fa2a200b9b6eb3b8483f305eadb4def8c6fffd8a000211357/renpy-0.9.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f0ee351d43c9c6ca0ec65aeb9280c3f4a49a307a231e8a0a1a50c19c3740f474",
"md5": "f1ded409a88829b4fa4fd1e75915e050",
"sha256": "1b9b99f3a07c7f6e137cd8d33798ba2b169967b956020e4b87cc59234a7acac6"
},
"downloads": -1,
"filename": "renpy-0.9.8.tar.gz",
"has_sig": false,
"md5_digest": "f1ded409a88829b4fa4fd1e75915e050",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6282,
"upload_time": "2025-08-26T05:31:02",
"upload_time_iso_8601": "2025-08-26T05:31:02.101476Z",
"url": "https://files.pythonhosted.org/packages/f0/ee/351d43c9c6ca0ec65aeb9280c3f4a49a307a231e8a0a1a50c19c3740f474/renpy-0.9.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-26 05:31:02",
"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"
}