{"id":24975233,"url":"https://github.com/tony-stone-code/python_script_automation-file_sorter","last_synced_at":"2025-11-06T09:03:02.580Z","repository":{"id":264282104,"uuid":"892924815","full_name":"Tony-Stone-Code/python_script_automation-file_sorter","owner":"Tony-Stone-Code","description":"This is a simple python script to help organise files into folders within a directory.","archived":false,"fork":false,"pushed_at":"2024-11-23T04:15:58.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T17:47:34.616Z","etag":null,"topics":["file-management","python","python-automation","python3","pythonprogramming"],"latest_commit_sha":null,"homepage":"","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/Tony-Stone-Code.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}},"created_at":"2024-11-23T04:11:12.000Z","updated_at":"2024-12-17T00:58:41.000Z","dependencies_parsed_at":"2024-11-23T05:28:51.453Z","dependency_job_id":null,"html_url":"https://github.com/Tony-Stone-Code/python_script_automation-file_sorter","commit_stats":null,"previous_names":["tony-stone-code/codealpha_python_script_automation-file_sorter-","tony-stone-code/python_script_automation-file_sorter","tony-stone-code/codealpha_python_script_automation-file_sorter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Stone-Code%2Fpython_script_automation-file_sorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Stone-Code%2Fpython_script_automation-file_sorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Stone-Code%2Fpython_script_automation-file_sorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Stone-Code%2Fpython_script_automation-file_sorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tony-Stone-Code","download_url":"https://codeload.github.com/Tony-Stone-Code/python_script_automation-file_sorter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246151318,"owners_count":20731574,"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","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":["file-management","python","python-automation","python3","pythonprogramming"],"created_at":"2025-02-03T20:47:10.809Z","updated_at":"2025-11-06T09:03:02.568Z","avatar_url":"https://github.com/Tony-Stone-Code.png","language":"Python","readme":"# File Sorter 📁\n\nAn intelligent, feature-rich file organization tool that automatically sorts your files into categorized folders. Built with Python and designed for ease of use with a beautiful command-line interface.\n\n[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## ✨ Features\n\n### Core Functionality\n- **Smart File Categorization**: Automatically organizes files into categories:\n  - 🎥 **Videos**: .mp4, .mkv, .avi, .mov, .wmv, .flv, .webm\n  - 🖼️ **Pictures**: .jpg, .jpeg, .png, .gif, .bmp, .svg, .ico, .tiff, .webp\n  - 🎵 **Music**: .mp3, .wav, .flac, .aac, .ogg, .m4a, .wma\n  - 📄 **Documents**: .pdf, .docx, .txt, .pptx, .xlsx, .doc, .xls, .ppt, .odt, .rtf\n  - 📦 **Archives**: .zip, .rar, .7z, .tar, .gz, .bz2, .xz\n  - 💻 **Code**: .py, .js, .java, .cpp, .c, .h, .cs, .php, .rb, .go, .rs, .html, .css\n  - ⚙️ **Executables**: .exe, .msi, .app, .deb, .rpm, .dmg\n  - 📊 **Spreadsheets**: .csv, .xlsx, .xls, .ods\n\n### Advanced Features\n- ⏪ **Undo Functionality**: Restore files to their original locations\n- 🔍 **Duplicate Detection**: Find duplicate files based on content hash\n- 📅 **Date-based Organization**: Organize files by modification date within categories\n- 🎯 **Dry Run Mode**: Preview what will be sorted before making changes\n- 🔧 **Custom Configuration**: Create custom file categories and rules\n- 📊 **Statistics**: View file distribution across categories\n- 🎨 **Beautiful CLI**: Rich, colorful terminal interface with progress indicators\n- 🔄 **Multiple Duplicate Strategies**: Skip, rename, or replace duplicate files\n\n## 📦 Installation\n\n### Option 1: Install from Source (Recommended)\n\n```bash\n# Clone the repository\ngit clone https://github.com/Tony-Stone-Code/python_script_automation-file_sorter.git\ncd python_script_automation-file_sorter\n\n# Install the package\npip install -e .\n```\n\n### Option 2: Install from PyPI (Coming Soon)\n\n```bash\npip install file-sorter\n```\n\n### Option 3: Install Dependencies Only\n\n```bash\npip install -r requirements.txt\n```\n\n## 🚀 Quick Start\n\nAfter installation, you can use the `file-sorter` command from anywhere in your terminal:\n\n```bash\n# Sort files in your Downloads folder (default)\nfile-sorter\n\n# Sort files in a specific directory\nfile-sorter -s /path/to/your/directory\n\n# Preview what would be sorted (dry run)\nfile-sorter --dry-run\n\n# Show statistics about files\nfile-sorter --stats\n```\n\n## 📖 Usage\n\n### Basic Commands\n\n```bash\n# Sort files in Downloads folder\nfile-sorter\n\n# Sort files in a custom directory\nfile-sorter --source /path/to/directory\n\n# Preview changes without moving files\nfile-sorter --dry-run\n\n# Organize files by date within categories\nfile-sorter --organize-by-date\n\n# Show file statistics\nfile-sorter --stats\n\n# Find duplicate files\nfile-sorter --find-duplicates\n```\n\n### Advanced Options\n\n```bash\n# Undo last 5 operations\nfile-sorter --undo 5\n\n# Use custom configuration file\nfile-sorter --config my_config.json\n\n# Handle duplicates by renaming (default)\nfile-sorter --duplicate-strategy rename\n\n# Handle duplicates by skipping\nfile-sorter --duplicate-strategy skip\n\n# Handle duplicates by replacing\nfile-sorter --duplicate-strategy replace\n\n# Watch mode - automatically sort new files\nfile-sorter --watch\n\n# Quiet mode (suppress output)\nfile-sorter --quiet\n```\n\n### Watch Mode (Continuous Monitoring)\n\nWatch mode continuously monitors a directory and automatically sorts new files as they appear:\n\n```bash\n# Install with watch support\npip install -e \".[watch]\"\n\n# Start watching Downloads folder\nfile-sorter --watch\n\n# Watch a specific directory\nfile-sorter --source /path/to/directory --watch\n```\n\nPress `Ctrl+C` to stop watching.\n\n### Command-Line Options\n\n| Option | Description |\n|--------|-------------|\n| `-s, --source DIR` | Source directory to sort (default: ~/Downloads) |\n| `-c, --config FILE` | Path to custom configuration JSON file |\n| `--dry-run` | Preview what would be done without moving files |\n| `--organize-by-date` | Organize files by modification date within categories |\n| `--duplicate-strategy {skip,rename,replace}` | How to handle duplicate files (default: rename) |\n| `--watch` | Watch directory and automatically sort new files (requires watchdog) |\n| `--undo COUNT` | Undo last COUNT file operations |\n| `--stats` | Show statistics about files in source directory |\n| `--find-duplicates` | Find and report duplicate files |\n| `-q, --quiet` | Suppress verbose output |\n| `--version` | Show version information |\n\n## ⚙️ Configuration\n\nYou can create a custom configuration file to define your own file categories:\n\n```json\n{\n  \"categories\": {\n    \"Videos\": [\".mp4\", \".mkv\", \".avi\", \".mov\"],\n    \"Pictures\": [\".jpg\", \".jpeg\", \".png\", \".gif\"],\n    \"Music\": [\".mp3\", \".wav\", \".flac\"],\n    \"Documents\": [\".pdf\", \".docx\", \".txt\"],\n    \"MyCustomCategory\": [\".custom\", \".ext\"]\n  }\n}\n```\n\nThen use it with:\n\n```bash\nfile-sorter --config my_config.json\n```\n\n## 🎯 Use Cases\n\n### Organize Downloads Folder\n```bash\nfile-sorter\n```\n\n### Clean Up Project Directory\n```bash\nfile-sorter --source ~/Projects/messy-folder --dry-run\nfile-sorter --source ~/Projects/messy-folder\n```\n\n### Archive Files by Date\n```bash\nfile-sorter --organize-by-date --source ~/Documents\n```\n\n### Find and Remove Duplicates\n```bash\nfile-sorter --find-duplicates --source ~/Pictures\n```\n\n## 🔧 Development\n\n### Running from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/Tony-Stone-Code/python_script_automation-file_sorter.git\ncd python_script_automation-file_sorter\n\n# Install in development mode\npip install -e .\n\n# Run the application\nfile-sorter\n```\n\n### Running Tests\n\n```bash\n# Run tests with unittest (no additional dependencies needed)\npython -m unittest discover -s tests -v\n\n# Or install pytest for more features\npip install pytest pytest-cov\n\n# Run tests with pytest\npytest\n\n# Run tests with coverage\npytest --cov=file_sorter\n```\n\n## 📝 Legacy Script\n\nThe original `files_sorter.py` script is still available for backwards compatibility:\n\n```bash\npython3 files_sorter.py\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with [Rich](https://github.com/Textualize/rich) for beautiful terminal output\n- Inspired by the need for better file organization\n\n## 🐛 Bug Reports\n\nIf you encounter any issues, please report them on the [GitHub Issues](https://github.com/Tony-Stone-Code/python_script_automation-file_sorter/issues) page.\n\n## ⭐ Support\n\nIf you find this tool useful, please consider giving it a star on GitHub!\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-stone-code%2Fpython_script_automation-file_sorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony-stone-code%2Fpython_script_automation-file_sorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-stone-code%2Fpython_script_automation-file_sorter/lists"}