Automating the process of sorting files in my downloads folder by file type.

Overview

downloads-folder-automation

Automating the process of sorting files in a user's downloads folder on Windows by file type.

This script iterates through the files in the downloads folder and moves them to their respective sub-folders. If the sub-folder does not exist, it is created then the files moved into it.

Prerequisites

This script requires Python to be installed for it to run. To install Python, click here.

Usage

From a terminal, navigate into the project directory.

$ cd downloads-folder-automation

To run the script:

$ python downloads_folder_sorter.py

To have the script run automatically, configure it in Windows Task Scheduler according to this tutorial.

Contributing

Please read HOW_TO_CONTRIBUTE.md for details on submitting pull requests.

License

This project is licensed under the MIT license - see the LICENCE.md for details.

Acknowledgement

I drew a lot of inspiration for this script from Nitish Sharma's medium article.

You might also like...
pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files
pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files

pytest-play pytest-play is a codeless, generic, pluggable and extensible automation tool, not necessarily test automation only, based on the fantastic

This project demonstrates selenium's ability to extract files from a website.

This project demonstrates selenium's ability to extract files from a website. I've added the challenge of connecting over TOR. This package also includes a personal archive site built in NodeJS and Angular that allows users to filter and view downloaded files.

Downloads separate (specified) file to a randomly generated folder in /TEMP then executes it.

PyTemp-1 A Python3 file downloader. What you do with this code / project / idea is non of my buisness or concern, and this was made for **educational*

Sorting-Algorithms - All information about sorting algorithm you need and you can visualize the code tracer

Sorting-Algorithms - All information about sorting algorithm you need and you can visualize the code tracer

Backup a folder to an another folder by using mirror update method.

Mirror Update Backup Backup a folder to an another folder by using mirror update method. How to use Install requirement pip install -r requirements.tx

Organizer is a python program that organizes your downloads folder

Organizer Organizer is a python program that organizes your downloads folder, it can run as a service and so will start along with the system, and the

Tattoo - System for automating the Gentoo arch testing process

Naming origin Well, naming things is very hard. Thankfully we have an excellent

Automatically move or copy files based on metadata associated with the files. For example, file your photos based on EXIF metadata or use MP3 tags to file your music files.

Automatically move or copy files based on metadata associated with the files. For example, file your photos based on EXIF metadata or use MP3 tags to file your music files.

Python package to read and display segregated file names present in a directory based on type of the file

tpyfilestructure Python package to read and display segregated file names present in a directory based on type of the file. Installation You can insta

A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.

django-webpacker's documentation: Introduction: django-webpacker is a django compressor tool which bundles css, js files to a single css, js file with

A Python library for automating interaction with websites.
A Python library for automating interaction with websites.

Home page https://mechanicalsoup.readthedocs.io/ Overview A Python library for automating interaction with websites. MechanicalSoup automatically stor

A set of libraries and functions for simplifying automating Cisco devices through SecureCRT.

This is a set of libraries for automating Cisco devices (and to a lesser extent, bash prompts) over ssh/telnet in SecureCRT.

Automating whatsapp with python

whatsapp-automation Automating whatsapp with python used on this project pyautogui pywhatkit pyttsx3 SpeechRecognition colorama embedded in python tim

Python client SDK designed to simplify integrations by automating key generation and certificate enrollment using Venafi machine identity services.
Python client SDK designed to simplify integrations by automating key generation and certificate enrollment using Venafi machine identity services.

This open source project is community-supported. To report a problem or share an idea, use Issues; and if you have a suggestion for fixing the issue,

A python library for creating selfbots/automating your Nertivia account.

nertivia-selfbot (WIP) A python library for creating selfbots/automating your Nertivia account. how to use Download the nertivia_selfbot folder from t

Milano is a tool for automating hyper-parameters search for your models on a backend of your choice.
Milano is a tool for automating hyper-parameters search for your models on a backend of your choice.

Milano (This is a research project, not an official NVIDIA product.) Documentation https://nvidia.github.io/Milano Milano (Machine learning autotuner

An open source raffle bot made to increase the chance of winning limited sneaker raffles by automating entries.
An open source raffle bot made to increase the chance of winning limited sneaker raffles by automating entries.

🚀 SyneziaRaffles An open source raffle bot made to increase the chance of winning limited sneaker raffles by automating entries. 🏄‍♂️ Quick Start Pr

This simple python script pcopy reads a list of file names and copies them to a separate folder

pCopy This simple python script pcopy reads a list of file names and copies them to a separate folder. Pre-requisites Python 3 (ver. 3.6) How to use

Comments
  • Added config file and some refactoring

    Added config file and some refactoring

    Resolves #2

    Made a few changes here:

    • Created categories.json to separate out the sorting logic.
    • Abstracted sort_folder to take any folder and moved specification of downloads folder into a main() function. So now if you want to import sort_folder somewhere else you can use it to sort any folder you want.
    • Some minor style changes

    Happy to adjust anything if you don't like the style changes.

    opened by DaraDadachanji 1
  • Misc file types are not moved into 'Other' folder

    Misc file types are not moved into 'Other' folder

    Currently the script does not move uncategorized files into their appropriate folder. Attempting to do so in a simple else block in sort_folder leads to all files being placed into Other and an error: destination path already exists.

    Traceback (most recent call last):
      File "C:\Users\ericm\PycharmProjects\downloads-folder-automation\downloads_folder_sorter.py", line 58, in <module>
        sort_folder(downloads_path)
      File "C:\Users\ericm\PycharmProjects\downloads-folder-automation\downloads_folder_sorter.py", line 52, in sort_folder
        move_file(file, destination)
      File "C:\Users\ericm\PycharmProjects\downloads-folder-automation\downloads_folder_sorter.py", line 34, in move_file
        shutil.move(file, destination)
      File "C:\Users\ericm\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 812, in move
        raise Error("Destination path '%s' already exists" % real_dst)
    shutil.Error: Destination path '\Users\ericm\Downloads\Other\manjaro-gnome-21.1.3-210916-linux513.iso.torrent' already exists
    
    bug 
    opened by eric-mahasi 0
  • Exception not handled if file already exists in the destination folder.

    Exception not handled if file already exists in the destination folder.

    An exception is thrown if the destination folder contains a file with the same name as the one that is being moved.

    C:\>python downloads_folder_sorter.py
    Traceback (most recent call last):
      File "C:\downloads_folder_sorter.py", line 69, in <module>
        sort_folder()
      File "C:\downloads_folder_sorter.py", line 65, in sort_folder
        move_file(file, other_path)
      File "C:\downloads_folder_sorter.py", line 41, in move_file
        shutil.move(file, dest_path)
      File "C:\Python39\lib\shutil.py", line 812, in move
        raise Error("Destination path '%s' already exists" % real_dst)
    shutil.Error: Destination path '\Users\USER_NAME\Downloads\Other\download.jfif' already exists
    
    help wanted 
    opened by Moskoskos 0
  • Configure categories from a flat file

    Configure categories from a flat file

    I think it would make sense to have a separate configuration file where you could keep the category details.

    Separating the code from the configuration makes things easier to read, and allows people to more easily change how they want to sort things without accidentally breaking the code.

    opened by DaraDadachanji 0
Owner
Eric Mahasi
Python developer. Data science enthusiast.
Eric Mahasi
A folder automation made using Watch-dog, it only works in linux for now but I assume, it will be adaptable to mac and PC as well

folder-automation A folder automation made using Watch-dog, it only works in linux for now but I assume, it will be adaptable to mac and PC as well Th

Parag Jyoti Paul 31 May 28, 2021
This file will contain a series of Python functions that use the Selenium library to search for elements in a web page while logging everything into a file

element_search with Selenium (Now With docstrings ?? ) Just to mention, I'm a beginner to all this, so it it's very possible to make some mistakes The

null 2 Aug 12, 2021
Mypy static type checker plugin for Pytest

pytest-mypy Mypy static type checker plugin for pytest Features Runs the mypy static type checker on your source files as part of your pytest test run

Dan Bader 218 Jan 3, 2023
This is a bot that can type without any assistance and have incredible speed.

BulldozerType This is a bot that can type without any assistance and have incredible speed. This bot currently only works on the site https://onlinety

null 1 Jan 3, 2022
Pytest-typechecker - Pytest plugin to test how type checkers respond to code

pytest-typechecker this is a plugin for pytest that allows you to create tests t

vivax 2 Aug 20, 2022
Main purpose of this project is to provide the service to automate the API testing process

PPTester project Main purpose of this project is to provide the service to automate the API testing process. In order to deploy this service use you s

null 4 Dec 16, 2021
FFPuppet is a Python module that automates browser process related tasks to aid in fuzzing

FFPuppet FFPuppet is a Python module that automates browser process related tasks to aid in fuzzing. Happy bug hunting! Are you fuzzing the browser? G

Mozilla Fuzzing Security 24 Oct 25, 2022
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.

Prism is a set of packages for API mocking and contract testing with OpenAPI v2 (formerly known as Swagger) and OpenAPI v3.x. Mock Servers: Life-like

Stoplight 3.3k Jan 5, 2023
Selects tests affected by changed files. Continous test runner when used with pytest-watch.

This is a pytest plug-in which automatically selects and re-executes only tests affected by recent changes. How is this possible in dynamic language l

Tibor Arpas 614 Dec 30, 2022
pytest plugin for manipulating test data directories and files

pytest-datadir pytest plugin for manipulating test data directories and files. Usage pytest-datadir will look up for a directory with the name of your

Gabriel Reis 191 Dec 21, 2022