{"id":30928185,"url":"https://github.com/mfm-347/lightnamer","last_synced_at":"2025-09-10T08:45:39.309Z","repository":{"id":311716119,"uuid":"1044716553","full_name":"MFM-347/LightNamer","owner":"MFM-347","description":"LightNamer is a CLI tool for renaming 100s of files in seconds.","archived":false,"fork":false,"pushed_at":"2025-08-26T06:52:50.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-26T07:23:45.804Z","etag":null,"topics":["automatic","automation","batch-file-renamer","contributions-welcome","mfm3478","opensource","py-lib","python","renamer"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/lightnamer/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MFM-347.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-08-26T05:34:34.000Z","updated_at":"2025-08-26T06:48:59.000Z","dependencies_parsed_at":"2025-08-26T07:23:46.849Z","dependency_job_id":null,"html_url":"https://github.com/MFM-347/LightNamer","commit_stats":null,"previous_names":["mfm-347/lightnamer","mfm-347/rencli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MFM-347/LightNamer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFM-347%2FLightNamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFM-347%2FLightNamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFM-347%2FLightNamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFM-347%2FLightNamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MFM-347","download_url":"https://codeload.github.com/MFM-347/LightNamer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MFM-347%2FLightNamer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274434235,"owners_count":25284430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automatic","automation","batch-file-renamer","contributions-welcome","mfm3478","opensource","py-lib","python","renamer"],"created_at":"2025-09-10T08:45:38.379Z","updated_at":"2025-09-10T08:45:39.298Z","avatar_url":"https://github.com/MFM-347.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **LightNamer: CLI \u0026 Library for Auto Renaming** 🚀\n\nLightNamer 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.\n\n## **📌 Features**\n\n| Feature             | Availability | Description                                                                   |\n| ------------------- | ------------ | ----------------------------------------------------------------------------- |\n| **Batch Rename**    | ✔           | Rename multiple files at once with a custom prefix.                           |\n| **Sorting Options** | ✔           | Rename files in alphabetical, newest, or oldest order.                        |\n| **Simulation Mode** | ✔           | Preview renaming changes without modifying files. No actual changes are made. |\n| **Library Support** | ✔           | Use LightNamer as a module in your Python scripts for automation.             |\n| **Cross-Platform**  | ✔           | Works seamlessly on Windows, macOS, and Linux.                                |\n\n## **🛠️ Prerequisites**\n\n- **Python 3.x** installed\n- Basic knowledge of **command-line usage**\n\n### **📦 Required Python Packages**\n\nLightNamer requires the following package(s):\n\n- `pyfiglet` (for CLI banner text)\n\nTo install dependencies, run:\n\n```sh\npip install -r requirements.txt  # Use pip3 on macOS\n```\n\n## **⚡ Installation**\n\n### **🔹 Install via Pip**\n\nTo install LightNamer as a library:\n\n```sh\npip install lightnamer\n```\n\n### **🔹 Install from Source**\n\nTo install and run the tool from the source code:\n\n```sh\ngit clone https://github.com/MFM-347/LightNamer.git\ncd LightNamer\npip install .\n```\n\n## **💻 CLI Usage**\n\n### **📌 Run the CLI**\n\n```sh\nlightnamer \u003cbase_name\u003e \u003cdirectory\u003e [-r \u003corder\u003e] [-s]\n```\n\n### **Example**\n\nRename files inside `C:\\Users\\YourName\\Documents\\Folder`, using \"File\" as the base name:\n\n```sh\nlightnamer \"File\" C:\\Users\\YourName\\Documents\\Folder\n```\n\n### **📂 Given Directory (`C:\\Docs`)**\n\n```\nreport.docx\nnotes.txt\nsummary.pdf\n```\n\n### **🏷️ Renaming Command**\n\n```sh\nlightnamer \"Document\" C:\\Docs -r alphabet\n```\n\n### **📝 Output**\n\n```\nDocument-1.docx\nDocument-2.pdf\nDocument-3.txt\n```\n\n## **⚙️ Command-Line Options**\n\n| Option                | Description                                  |\n| --------------------- | -------------------------------------------- |\n| `\u003cbase_name\u003e`         | Prefix for renamed files.                    |\n| `\u003cdirectory\u003e`         | Path to folder containing the files.         |\n| `-r, --order \u003corder\u003e` | Sorting order before renaming:               |\n|                       | - `alphabet` → A-Z order                     |\n|                       | - `new` → Newest to oldest                   |\n|                       | - `old` → Oldest to newest (default)         |\n| `-s, --simulate`      | Run a **simulation** without renaming files. |\n| `--case-sensitive`    | Sorts filenames in case-sensitive mode.      |\n| `--debug`             | Enables debug logging.                       |\n\n## **📦 Using LightNamer as a Library**\n\n### **🔹 Installed Library Usage**\n\nIf you have installed LightNamer via `pip`, you can use it in your Python scripts as follows:\n\n```python\nfrom lightnamer import renFn\nfrom pathlib import Path\n\ndirectory = Path(\"C:/Users/YourName/Documents/Folder\")\nrenFn(base_name=\"Document\", directory=directory, order=\"alphabet\", simulate=False, case_sensitive=False)\n```\n\n### **🔹 Source Code Usage**\n\nIf running directly from the cloned source repository:\n\n```python\nfrom lightnamer import renFn\nfrom pathlib import Path\n\ndirectory = Path(\"C:/Users/YourName/Documents/Folder\")\nrenFn(base_name=\"Document\", directory=directory, order=\"alphabet\", simulate=False, case_sensitive=False)\n```\n\n### **Sorting Files Only**\n\nIf you only need to **get sorted files** without renaming:\n\n```python\nfrom lightnamer import sortFn\nfrom pathlib import Path\n\ndirectory = Path(\"/path/to/files\")\nsorted_files = sortFn(directory, order=\"new\", case_sensitive=True)\nprint(sorted_files)\n```\n\n### **Handling Errors Gracefully**\n\nYou can wrap it in a try-except block:\n\n```python\ntry:\n    renFn(\"Example\", Path(\"/home/user/files\"), \"old\", False, False)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n```\n\n## **🧪 Running Tests (For Source Code Only)**\n\nRun all tests:\n\n```sh\npython -m unittest discover tests\n```\n\n## Future Plans\n\n- Add option to rename only specific file type.\n- Add Graphic User Interface (GUI).\n\n## **🤝 Contributing**\n\nWe welcome contributions! Please check the [CONTRIBUTING.md](https://github.com/MFM-347/LightNamer/blob/main/CONTRIBUTING.md) for guidelines.\n\n## **👨‍💻 Credits**\n\nCreated and maintained by [MFM-347](https://github.com/MFM-347).\n\n## **📜 License**\n\nThis project is licensed under the **MIT License**.\n\n[![License MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/MFM-347/LightNamer/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfm-347%2Flightnamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfm-347%2Flightnamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfm-347%2Flightnamer/lists"}