Skip to main content

CLI utility to sort directories based on file extensions

Project description

cleandir

Organizes a directory's contents into subdirectories based on file extensions.

Say goodbye to navigating between hundreds of files in your downloads directory!

Installation

pip install cleandir

Usage

Just pass the directory to organize as an argument

cleandir <dir-name>

By default, cleandir organizes files using the following rules:

  • audio: flac, mp3, ogg, wav
  • documents: docx, pdf, pptx, xlsx
  • misc: 7z, deb, exe, rar, zip
  • pictures: gif, jpg, png, svg, webp
  • videos: mkv, mov, mp4, webm

Extensions outside this rule are ignored

Custom rules can be passed by creating a JSON file directories and list of extensions:

{
  "audio": ["mp3", "wav"],
  "code": ["py", "c", "js"],
}
cleandir --json-file <json-file> <dir-name>

If duplicates files exists in the created directory, they can be removed by using the --delete-duplicates flag:

cleandir -d <dir-name>

Available help can be seen through the --help flag:

cleandir --help

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

dircleaner-0.1.0.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

dircleaner-0.1.0-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

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