Skip to main content

Organize files by extension into category folders from the command line.

Project description

Downsorter

A small Python CLI tool that organizes files by extension into category folders.

Use it to clean up a messy folder, especially downloads, by moving images, documents, archives, installers, code, audio, and video files into the right subfolders.

Features

  • Organizes files by extension into category folders
  • Preview mode so you can see changes before moving anything
  • Safe move mode with --apply to actually perform the file moves
  • Handles duplicate names by renaming files to name (1).ext, name (2).ext, etc.
  • Ignores common system files like desktop.ini and thumbs.db
  • Supports minimum file age filtering with --min-age-days
  • Writes a CSV log of all moves for auditing
  • Works on Windows, macOS, and Linux with Python 3.10+

Platform Support

Platform Support Notes
Windows 10/11 Supported Best tested platform for this project
macOS Supported Works with Python 3.10+
Linux Supported Works with Python 3.10+

Files

  • sorter.py - main CLI script and package entry point
  • README.md - project instructions
  • pyproject.toml - package metadata for PyPI
  • LICENSE - MIT license text
  • movelogs.csv - example move log file written by the script

Install

From source

pip install .

From PyPI

pip install downsorter

Usage

Preview what will happen

This is the safest way to run the tool first.

downsorter --folder "C:\Users\YourName\Downloads"

Actually move files

downsorter --folder "C:\Users\YourName\Downloads" --apply

Only move files older than 7 days

downsorter --folder "C:\Users\YourName\Downloads" --min-age-days 7 --apply

Use a custom log file

downsorter --folder "C:\Users\YourName\Downloads" --apply --log-file my-moves.csv

Options

  • --folder: Folder to organize. Defaults to the current user's Downloads folder.
  • --apply: Actually move files. Without this flag, the script only previews the planned moves.
  • --min-age-days: Only move files that have not been modified for at least this many days.
  • --log-file: CSV file where completed moves are recorded.

How it works

  1. The script scans the target folder for files.
  2. It matches each file extension against a category list.
  3. It builds a plan showing where each file would move.
  4. In preview mode, it only prints the plan.
  5. In apply mode, it creates category folders, moves files, and logs the results.

Categories

The project currently sorts files into:

  • Images (.jpg, .jpeg, .png, .webp, .bmp)
  • PDFs (.pdf)
  • Documents (.doc, .docx, .txt, .md, .rtf)
  • Spreadsheets (.xls, .xlsx, .csv, .tsv)
  • PPTs (.ppt, .pptx)
  • Archives (.rar, .zip, .7z, .tar, .gz)
  • Installers (.exe, .msi)
  • Code (.py, .js, .html, .css, .json, .xml, .cpp, .java)
  • Audio (.mp3, .wav, .flac, .aac, .ogg)
  • Videos (.mp4, .gif, .mov, .mkv, .avi, .webm)
  • Other for everything else

Example

Run this to preview then apply:

downsorter --folder "C:\Users\YourName\Downloads"
downsorter --folder "C:\Users\YourName\Downloads" --apply

License

This project is licensed under the MIT License.

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

downsorter-0.2.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

downsorter-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file downsorter-0.2.0.tar.gz.

File metadata

  • Download URL: downsorter-0.2.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for downsorter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 533b998ec58105fa8597a7c524d141d16bc00d9cc60d26c6fd79ac3cef3a24c0
MD5 c2d40bd7541fb8d46ab81b8c9924fd3b
BLAKE2b-256 7b11c162d9e2204c830458a6784eeef1cd7d05da54435e017d24d00d8182e306

See more details on using hashes here.

File details

Details for the file downsorter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: downsorter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for downsorter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da3a32890b00d871081972ad331543892d82e183a3f1f3af226af8aa0ff01761
MD5 897b252fa441c0ec13541d5de9143721
BLAKE2b-256 853843e5affe878737d1904d2b3ed4744d23c401e69724d5f1d6bc0c512e7016

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