Skip to main content

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

Release files for dircleaner 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dircleaner 0.1.0
File Size Uploaded
dircleaner-0.1.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dircleaner 0.1.0
File Interpreter ABI Platform
dircleaner-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / dircleaner-0.1.0.tar.gz

Download URL dircleaner-0.1.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ec0f95f879a782ce1a97f2c9bd6e46abd87b8422cb97e47ae406ce003600c076
BLAKE2b-256 checksum
How to use checksums
6ca1853df143926deeb9d47da154f915692adbe0212110dfb1831c9a45c258ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / dircleaner-0.1.0-py3-none-any.whl

Download URL dircleaner-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de143c26d30f777a9c74a98da55dee69632fe874014864ac652769eb16a0d92b
BLAKE2b-256 checksum
How to use checksums
7241f5aebb1860dffd280cf3bf834b1a44273db3a381211e4125d1013c0ca116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page