GithubHelp home page GithubHelp logo

file-organizer's Introduction

File Organizer CLI Tool

This command-line interface (CLI) tool organizes files in a specified directory based on their types. It uses the magic library to identify file types by content, allowing for accurate categorization even when file extensions are unreliable.

Features

  • Automatic File Categorization: Files are categorized into directories such as Images, Videos, Documents, Music, Archives, and Others based on their MIME types.
  • Flexible and Customizable: Easily customizable to add more categories or modify existing ones in the organizer.py script.
  • Command-Line Interface: Simple to use directly from the command line with Python.

Requirements

  • Python 3.x
  • python-magic library

Installation

  1. Clone the repository:
git clone https://github.com/mgiannopoulos24/File-Organizer
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Navigate to the directory containing organizer.py:
cd path/to/file_organizer
  1. Run the organizer tool with the path to the directory you want to organize:
python3 organizer.py /path/to/your/source/directory

Replace /path/to/your/source/directory with the path to the directory containing the files you want to organize.

Example

Suppose you have a directory ~/Downloads with various files:

User@Github:~$ ll ~/Downloads/
total 5316
drwxr-xr-x  2 dwish dwish    4096 Jul 17 01:16  ./
drwxr-x--- 21 dwish dwish    4096 Jul 17 01:11  ../
-rw-r--r--  1 dwish dwish   20480 Jul 16 02:53  archive.zip
-rw-r--r--  1 dwish dwish 2689704 Jul 17 01:14  audio.mp3
-rw-r--r--  1 dwish dwish    1965 Jul 17 01:11  document.pdf
-rw-r--r--  1 dwish dwish    1781 Nov 30  2023  photo.jpg
-rw-r--r--  1 dwish dwish      74 Jul 17 01:14  script.sh
-rw-r--r--  1 dwish dwish 2689704 Jul 17 01:14  video.mp4

Running the organizer tool:

python3 organizer.py ~/Downloads

After running, your directory structure will look like this:

User@Github:~$ ll ~/Downloads/
total 32
drwxr-xr-x  8 dwish dwish 4096 Jul 17 01:18 ./
drwxr-x--- 21 dwish dwish 4096 Jul 17 01:17 ../
drwxr-xr-x  2 dwish dwish 4096 Jul 17 01:18 Archives/
drwxr-xr-x  2 dwish dwish 4096 Jul 17 01:18 Documents/
drwxr-xr-x  2 dwish dwish 4096 Jul 17 01:18 Images/
drwxr-xr-x  2 dwish dwish 4096 Jul 17 01:18 Music/
drwxr-xr-x  2 dwish dwish 4096 Jul 17 01:18 Others/
drwxr-xr-x  2 dwish dwish 4096 Jul 17 01:18 Videos/

Contributing

Contributions are welcome! Feel free to fork the repository, create pull requests, and suggest improvements.

Acknowledgments

  • Inspired by the need to organize files efficiently.
  • Special thanks to the creators of the python-magic library for MIME type identification.

file-organizer's People

Contributors

mgiannopoulos24 avatar

Stargazers

V. Kokkinos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.