Skip to main content

A tool for organizing files automatically

Project description

File Organizer Automation

A Python-based utility that automates file organization tasks to help keep your directories clean and structured. This tool can monitor directories, sort files based on extensions, apply naming conventions, and automate organization at system startup.

Installation

You can install the package directly from PyPI:

pip install file-organizer-automation

Or install from source:

git clone https://github.com/splunkdevabhi/file_organizer_automation.git
cd file-organizer-automation
pip install -e .

Features

  • Automatic File Sorting: Organizes files based on file extensions or custom rules
  • Directory Monitoring: Watches specified directories for changes and organizes files in real-time
  • Custom Organization Rules: Define your own organization logic through configuration files
  • Platform Support: Works on macOS (using launchd) and Linux (using systemd)
  • Startup Automation: Can be configured to run automatically at system login
  • Logging: Comprehensive logging of all file operations
  • Command-line Interface: Easy-to-use commands for installation and configuration

Installation

Prerequisites

  • Python 3.6 or higher
  • pip (Python package installer)

Install from GitHub

# Clone the repository
git clone https://github.com/splunkdevabhi/file_organizer_automation.git

# Navigate to the project directory
cd file_organizer_automation

# Install the package
pip install -e .

Install from PyPI

pip install file-organizer-automation

Usage Examples

Basic Usage

from file_organizer.core.organizer import FileOrganizer

# Initialize the organizer
organizer = FileOrganizer('/path/to/directory')

# Organize files by extension
organizer.organize_by_extension()

# Organize files by creation date
organizer.organize_by_date()

Command Line Interface

# Organize a specific directory
file-organizer --path /path/to/directory

# Setup automated organization at login
file-organizer --setup-startup

# Remove startup automation
file-organizer --remove-startup

# Run with a custom configuration file
file-organizer --config /path/to/config.json

Project Structure

file_organizer_automation/
├── file_organizer/               # Main package
│   ├── core/                     # Core functionality
│   │   ├── __init__.py
│   │   └── organizer.py          # Main organizer class
│   ├── utils/                    # Utility functions
│   │   └── __init__.py
│   ├── scripts/                  # Scripts for automation
│   │   └── startup.py            # Startup automation script
│   └── __init__.py
├── tests/                        # Test suite
├── docs/                         # Documentation
├── setup.py                      # Package installation configuration
├── .gitignore                    # Git ignore file
├── LICENSE                       # License file
└── README.md                     # This file

Dependencies

  • Python 3.6+: Core language
  • watchdog: For real-time file system monitoring
  • schedule: For scheduling organization tasks
  • click: For command-line interface
  • appdirs: For determining platform-specific directories

Configuration

The file organizer can be configured using a JSON configuration file:

{
  "directories": {
    "watch": [
      "~/Downloads",
      "~/Desktop"
    ],
    "exclude": [
      "~/Downloads/Important"
    ]
  },
  "rules": [
    {
      "extensions": ["jpg", "png", "gif", "bmp"],
      "destination": "~/Pictures"
    },
    {
      "extensions": ["doc", "docx", "pdf", "txt"],
      "destination": "~/Documents"
    },
    {
      "extensions": ["mp3", "wav", "flac"],
      "destination": "~/Music"
    }
  ],
  "options": {
    "create_subdirectories": true,
    "preserve_original_name": true,
    "date_format": "%Y-%m-%d"
  }
}

Contributing Guidelines

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Submit a pull request

Coding Standards

  • Follow PEP 8 style guide
  • Include docstrings for all functions, classes, and modules
  • Write unit tests for new features
  • Keep functions small and focused on a single responsibility

License

This project is licensed under the MIT License - see the LICENSE file for details.

Demo

Here is a demonstration of the file organizer in action.

Before Organization:

test_files/
├── document1.txt
├── document2.doc
├── script.py
├── test.jpg
├── test.png
└── webpage.html

After Organization:

test_files/
├── doc/
│   └── document2.doc
├── html/
│   └── webpage.html
├── jpg/
│   └── test.jpg
├── png/
│   └── test.png
├── py/
│   └── script.py
└── txt/
    └── document1.txt

The file organizer successfully categorizes files into directories based on their extensions:

  • Documents (.txt, .doc)
  • Images (.jpg, .png)
  • Code files (.py)
  • Web files (.html)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

  • Abhishek Shukla - Initial work

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_organizer_automation-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

file_organizer_automation-0.1.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file file_organizer_automation-0.1.0.tar.gz.

File metadata

File hashes

Hashes for file_organizer_automation-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f217592de14fcd15a482019e9edd97f7752574d6a1f5a03c894d37f8d444bb56
MD5 1bca3ac6e9fdff1c8321a5f1458ea559
BLAKE2b-256 2939addace28537d026c161f77b7c3a35f51af9f68bcf2c78d947321740a0c91

See more details on using hashes here.

File details

Details for the file file_organizer_automation-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for file_organizer_automation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8220eb0b8e6a4ce8a78db8bd575d9c6b0544f5637cfc18c5593e7fd1e5f31c12
MD5 8b495ee7ae672fdb8264dfccbaf0e9fd
BLAKE2b-256 9f51b38d7782d0ae19c093f112cf456eec2bb4737737d31008e0418e7ab726d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page