Skip to main content

A simple Python CLI tool to automatically sort files into directories by type

Project description

catfile

A simple Python script that automatically organizes files in a directory into folders based on their file types.
If a file type is not recognized, it will be placed in the others folder.

Features

  • Sorts files into categories such as application, images, documents, spreadsheets, presentation, audio, video, archives, code
  • Automatically creates the target folders if they don't exist
  • Puts unknown file types into an others folder
  • Cross-platform support (Linux, macOS, Windows)

Example

Before sorting: Alt text

After Sorting : Alt text

How to Install

How to Use

  • Open terminal in the directory you want to sort
  • Type catfile
  • directories (optional) use to determined wich directories you want the script to run. If empty will default into the current directory
  • flags (optional) use to determine wich directories you want to create. If empty will create all directories

Flags

flags determined wich directories will be created, you can combine multiple flags by typing catfile -flags.

  • -a create a directory for applications only
  • -i create a directory for images only
  • -d create a directory for documents only
  • -s create a directory for spreadsheets only
  • -p → create a directory for Presentations only
  • -au → create a directory for Audio files only
  • -v → create a directory for Videos only
  • -ar → create a directory for Archives / compressed files only
  • -c → create a directory for Code / source files only

You can combine multiple arguments for example:

catfile Downloads/ -a -c -d

Will sort files in the Downloads directories that match the directories created wich is applicaton, code, and documents

Supported File Types

  • Applications
    .exe, .msi, .bat, .cmd, .app, .dmg, .pkg, .bin, .run, .sh, .deb, .rpm, .jar, .apk, .xpi

  • Images
    .jpg, .jpeg, .png, .gif, .bmp, .tiff, .tif, .webp, .avif, .heif, .heic, .svg, .eps, .ai, .cr2, .cr3, .nef, .arw, .orf, .rw2, .dng

  • Documents
    .txt, .rtf, .odt, .md, .doc, .docx, .dot, .dotx, .pdf, .epub, .mobi, .azw3

  • Spreadsheets
    .xls, .xlsx, .xlsm, .xlsb, .xlt, .xltx, .xltm, .ods, .ots, .csv, .tsv, .numbers

  • Presentations
    .ppt, .pptx, .pptm, .pot, .potx, .potm, .odp, .otp, .key

  • Audio
    .mp3, .aac, .ogg, .wma, .m4a, .wav, .flac, .alac, .aiff, .aif, .opus, .amr, .mid, .midi

  • Video
    .mp4, .m4v, .mov, .avi, .wmv, .flv, .mkv, .webm, .ogv, .3gp, .3g2, .mts, .m2ts, .ts, .vob

  • Archives
    .zip, .rar, .7z, .tar, .gz, .bz2, .xz, .iso, .img, .dmg, .vhd, .vhdx, .tgz, .tbz2, .lz, .z

  • Code
    .html, .htm, .css, .js, .mjs, .cjs, .ts, .tsx, .php, .phtml, .rb, .aspx, .cshtml, .py, .pyw, .ipynb, .java, .c, .h, .cpp, .cc, .cxx, .hpp, .hxx, .cs, .go, .rs, .kt, .kts, .swift, .m, .mm, .sh, .bash, .ps1, .pl, .pm, .lua, .r, .R, .m, .jl, .sas, .yml, .yaml, .json, .xml, .toml, .ini, .md

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

catfile-1.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

catfile-1.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file catfile-1.0.1.tar.gz.

File metadata

  • Download URL: catfile-1.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for catfile-1.0.1.tar.gz
Algorithm Hash digest
SHA256 eeaa17dc27cc4428c55ee83ffdccca7c45e7ddc9fa449ca6ff6f7f1ae30b5edf
MD5 9f19c925f372d06f874cd33115699bd6
BLAKE2b-256 bb3432ea9fba2b07738d437fb3759d3d795918135d07771dd828b396b326928f

See more details on using hashes here.

File details

Details for the file catfile-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: catfile-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for catfile-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d966d7da958be29bc995af665106ab85579f137d660100dd4c798e1e01d854a
MD5 8ba8e0998b4430f78412c5eed33879d9
BLAKE2b-256 a1ca93886b35ce27c5565a3ec592a6a41dbd4d39143e84dc4f567e5faa87a6cd

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