项目作者: tfeldmann

项目描述 :
The file management automation tool.
高级语言: Python
项目地址: git://github.com/tfeldmann/organize.git
创建时间: 2017-09-20T10:00:28Z
项目社区:https://github.com/tfeldmann/organize

开源协议:MIT License

下载




organize v3 is out










organize - The file management automation tool


Full documentation at Read the docs

v3 is now available

The new version should be much faster and fix a lot of bugs. It also comes with
a some new actions, filters and options.

If you encounter any other bugs or problems during the migration, please reach out!

About

Your desktop is a mess? You cannot find anything in your downloads and
documents? Sorting and renaming all these files by hand is too tedious?
Time to automate it once and benefit from it forever.

organize is a command line, open-source alternative to apps like Hazel (macOS)
or File Juggler (Windows).

People use this for:

  • Sorting and tagging pictures into various folder structures based on EXIF data
  • Sorting and renaming PDF invoices based on file content
  • Removing incomplete downloads from their ~/Downloads
  • Cleaning up their ~/Desktop from unused files
  • Freeing up disk space by removing duplicates
  • Automating various business processes
  • and many more

Features

Some highlights include:

  • Safe moving, renaming, copying of files and folders with conflict resolution options.
  • Fast duplicate file detection.
  • Exif tags extraction.
  • Categorization via text extracted from PDF, DOCX and many more.
  • Powerful template engine.
  • Inline python and shell commands as filters and actions for maximum flexibility.
  • Everything can be simulated before touching your files.
  • Works on macOS, Windows and Linux.
  • Free and open source software.

Getting started

Installation

Only python 3.9+ is needed.
Install it via your package manager or from python.org.

Installation is done via pip. Note that the package name is organize-tool:

  1. pip install -U organize-tool

This command can also be used to update to the newest version. Now you can run organize --help to check if the installation was successful.

Create your first rule

In your shell, run organize new and then organize edit to edit the configuration:

  1. rules:
  2. - name: "Find PDFs"
  3. locations:
  4. - ~/Downloads
  5. subfolders: true
  6. filters:
  7. - extension: pdf
  8. actions:
  9. - echo: "Found PDF!"

If you have problems editing the configuration you can run organize show --reveal to reveal the configuration folder in your file manager. You can then edit the config.yaml in your favourite editor.

save your config file and run:

  1. organize run

You will see a list of all .pdf files you have in your downloads folder (+ subfolders).
For now we only show the text Found PDF! for each file, but this will change soon…
(If it shows Nothing to do you simply don’t have any pdfs in your downloads folder).

Run organize edit again and add a move-action to your rule:

  1. actions:
  2. - echo: "Found PDF!"
  3. - move: ~/Documents/PDFs/

Now run organize sim to see what would happen without touching your files.

You will see that your pdf-files would be moved over to your Documents/PDFs folder.

Congratulations, you just automated your first task. You can now run organize run
whenever you like and all your pdfs are a bit more organized. It’s that easy.

There is so much more. You want to rename / copy files, run custom shell- or python scripts, match names with regular expressions or use placeholder variables? organize has you covered. Have a look at the advanced usage example below!

Example rules

Here are some examples of simple organization and cleanup rules. Modify to your needs!

Move all invoices, orders or purchase documents into your documents folder:

  1. rules:
  2. - name: "Sort my invoices and receipts"
  3. locations: ~/Downloads
  4. subfolders: true
  5. filters:
  6. - extension: pdf
  7. - name:
  8. contains:
  9. - Invoice
  10. - Order
  11. - Purchase
  12. case_sensitive: false
  13. actions:
  14. - move: ~/Documents/Shopping/

Recursively delete all empty directories:

  1. rules:
  2. - name: "Recursively delete all empty directories"
  3. locations:
  4. - path: ~/Downloads
  5. targets: dirs
  6. subfolders: true
  7. filters:
  8. - empty
  9. actions:
  10. - delete

You’ll find many more examples in the full documentation.

Command line interface

  1. organize - The file management automation tool.
  2. Usage:
  3. organize run [options] [<config>]
  4. organize sim [options] [<config>]
  5. organize new [<config>]
  6. organize edit [<config>]
  7. organize check [<config>]
  8. organize debug [<config>]
  9. organize show [--path|--reveal] [<config>]
  10. organize list
  11. organize docs
  12. organize --version
  13. organize --help
  14. Commands:
  15. run Organize your files.
  16. sim Simulate organizing your files.
  17. new Creates a new config.
  18. edit Edit the config file with $EDITOR.
  19. check Check whether the config file is valid.
  20. debug Shows the raw config parsing steps.
  21. show Print the config to stdout.
  22. Use --reveal to reveal the file in your file manager
  23. Use --path to show the path to the file
  24. list Lists config files found in the default locations.
  25. docs Open the documentation.
  26. Options:
  27. <config> A config name or path to a config file
  28. -W --working-dir <dir> The working directory
  29. -F --format (default|jsonl) The output format [Default: default]
  30. -T --tags <tags> Tags to run (eg. "initial,release")
  31. -S --skip-tags <tags> Tags to skip
  32. -h --help Show this help page.

Other donation options:

ETH:

  1. 0x8924a060CD533699E230C5694EC95b26BC4168E7

BTC:

  1. 39vpniiZk8qqGB2xEqcDjtWxngFCCdWGjY