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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dircleaner-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for dircleaner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec0f95f879a782ce1a97f2c9bd6e46abd87b8422cb97e47ae406ce003600c076
MD5 1eca673487ecdfdbd27cd80aa2c1d61c
BLAKE2b-256 6ca1853df143926deeb9d47da154f915692adbe0212110dfb1831c9a45c258ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dircleaner-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for dircleaner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de143c26d30f777a9c74a98da55dee69632fe874014864ac652769eb16a0d92b
MD5 c7513bca524b8875d11293586b286dda
BLAKE2b-256 7241f5aebb1860dffd280cf3bf834b1a44273db3a381211e4125d1013c0ca116

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