{"id":13595908,"url":"https://github.com/ericpruitt/mimesort","last_synced_at":"2025-10-09T06:20:22.123Z","repository":{"id":66789042,"uuid":"2463779","full_name":"ericpruitt/mimesort","owner":"ericpruitt","description":"Sorts files based on MIME types","archived":false,"fork":false,"pushed_at":"2017-03-12T07:58:54.000Z","size":8,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-12T06:56:30.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericpruitt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2011-09-26T22:16:06.000Z","updated_at":"2018-07-11T17:26:55.000Z","dependencies_parsed_at":"2023-03-12T14:16:54.949Z","dependency_job_id":null,"html_url":"https://github.com/ericpruitt/mimesort","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericpruitt/mimesort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpruitt%2Fmimesort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpruitt%2Fmimesort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpruitt%2Fmimesort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpruitt%2Fmimesort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericpruitt","download_url":"https://codeload.github.com/ericpruitt/mimesort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpruitt%2Fmimesort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000849,"owners_count":26082950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:02:00.928Z","updated_at":"2025-10-09T06:20:22.097Z","avatar_url":"https://github.com/ericpruitt.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"mimesort\n========\n\nMimesort is used to sort files and folders into labeled folders based on MIME\ntypes. When deciding what MIME classification to use for a folder, mimesort\nchecks the MIME type of every file within the folder and will classify a folder\nbased on the most commonly occurring type. By default, if the MIME types that\noccur in a folder are not all the same, the folder is classified as \"mixed.\"\nThis can be changed by adjusting the diversity threshold. The diversity of a\nfolder is determined by the [Shannon\nindex](http://en.wikipedia.org/wiki/Diversity_index#Shannon_index) of the MIME\ntypes of its contents.\n\nI have a nightly entry in my crontab that I use to sort my downloads directory:\n\n    mimesort.py  -d .6  ~/Downloads\n\nA Shannon index threshold of 0.6 does a good job of classifying folders to my\nliking, but I recommend doing some dry-runs to see works best for you.\n\n\nUsage\n-----\n\nThe scripts usage is pretty simple:\n\n    mimesort.py [OPTIONS] [DIRECTORY... [DESTINATION]]\n\nWhen no directory is supplied, mimesort works on the current working directory\nbut prompts the user before proceeding. When multiple directories are supplied\nas arguments, the last folder is used as the destination for the sorted\ncontents of the preceding folders.\n\n\nExample\n-------\n\n    ~/Downloads$ mimesort -d 0.6 | tail -n15\n    ./shellinabox_2.10-1_amd64.deb                     debian-package\n    ./Bat Euthanasia.pdf                               pdf\n    ./AmazonMP3-1309433311.amz                         plain\n    ./cruisecontrol-bin-2.8.4                    1.566 mixed\n    ./WebShell-0.9.6                             1.476 mixed\n    ./kien-ctrlp.vim-e50970f.tar.gz                    tar\n    ./531 Manual.pdf                                   pdf\n    ./xflux.tgz                                        tar\n    ./mHXiz.png                                        image\n    ./Full ...otherhood 1-64 (Eng Dub)           0.000 video\n    ./Sunflower-0.1a-26.tgz                            tar\n    ./ipmansubs.zip                                    zip\n    ./Pokemans.mp3                                     audio\n    ./Windo...it-English-Developer.iso                 iso9660-image\n    ./amazonmp3                                  0.000 debian-package\n\n    ~/Downloads$ ls\n    audio           iso9660-image   pdf                     shellscript\n    csv             java-archive    plain                   tar\n    debian-package  java-jnlp-file  postscript              unknown\n    document        message         redhat-package-manager  video\n    executable      mixed           ruby                    xml\n    image           msdos-program   sh                      zip\n\n\nOptions\n-------\n\n### -h ###\n\nDisplays a brief overview of the command line arguments accepted by mimesort.\n\n### -d _NUMBER_ ###\n\nDefines the threshold for determining whether or not a folder is classified as\n\"mixed\" instead of the most commonly occurring MIME type. The default threshold\nis 0.0.\n\n### -i ###\n\nTells the script not to try to sort folders that, based on the folder names,\nappears to already be sorted.\n\n### -n ####\n\nDisplays a list of files, folders, their Shannon index values and\nclassifications but does not actually move anything around. This is essentially\na dry-run.\n\n### -m ###\n\nDo not use magic file libraries even if they are available. This is useful for\ncategorizing large quantities of files since the magic file libraries read data\nfrom the file to determine its type, but the classifications will generally be\nless accurate.\n\n### -y ###\n\nWhen mimesort is called without any arguments, it will attempt to sort the\ncurrent working directory but prompts the user before doing so. This argument\neliminates the prompt and will sort the current working directory immediately.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericpruitt%2Fmimesort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericpruitt%2Fmimesort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericpruitt%2Fmimesort/lists"}