|
| 1 | +# dirganize |
| 2 | + |
| 3 | +Declutter you folders and get peace of mind. |
| 4 | +A command-line tool to organize files into category directories. |
| 5 | + |
| 6 | +[](https://github.com/aahnik/dirganize/actions/workflows/test.yml) |
| 7 | +[](https://github.com/aahnik/dirganize/actions/workflows/quality.yml) |
| 8 | +[](https://codecov.io/gh/aahnik/dirganize) |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +```shell |
| 13 | +pip install dirganize |
| 14 | +``` |
| 15 | + |
| 16 | +## Usage |
| 17 | + |
| 18 | +Dirganize has an ultra simple command-line interface. |
| 19 | +Just move into the directory you want to organize, and run `dirganize`. |
| 20 | + |
| 21 | +You can also specify which folder to organize by using the `path` option. |
| 22 | + |
| 23 | +```shell |
| 24 | +dirganize --path ~/Downloads |
| 25 | +``` |
| 26 | + |
| 27 | +If no path is specified, dirganize works on the current directory. |
| 28 | + |
| 29 | +## Configuration |
| 30 | + |
| 31 | +By default `dirganize` determines the destination folder for a particular file by |
| 32 | +guessing its type from its extension. |
| 33 | +The |
| 34 | +[`guess_type`](https://docs.python.org/3/library/mimetypes.html#mimetypes.guess_type) |
| 35 | +function of python's inbuilt module |
| 36 | +[`mimetypes`](https://docs.python.org/3/library/mimetypes.html) |
| 37 | +is used for this purpose. |
| 38 | + |
| 39 | +> ***NOTE*** Dotfiles are not affected by dirganize. |
| 40 | +
|
| 41 | +You can put a `.dirganize.yml` file ( inside the folder you want to dirganize ) |
| 42 | +to provide a custom configuration. |
| 43 | + |
| 44 | +```yaml |
| 45 | +# .dirganize.yml |
| 46 | +# folder: [ext1,ext2, ...] |
| 47 | +Animations: [gif] |
| 48 | +Binaries: [bin,dat] |
| 49 | +``` |
| 50 | +
|
| 51 | +Basically you have the folder name, |
| 52 | +mapped to the list of file types to put in that folder. |
| 53 | +
|
| 54 | +Dirganize will first try to determine the destination directory from the `.dirganize.yml`. |
| 55 | +When the yaml configuration file is absent or |
| 56 | +the folder for an encountered file type is not defined in the configuration, |
| 57 | +`dirganize` will fallback to the default technique. |
0 commit comments