https://github.com/programie/folderactions
Automatically trigger specific actions like moving specific files in a monitored folder
https://github.com/programie/folderactions
Last synced: 19 days ago
JSON representation
Automatically trigger specific actions like moving specific files in a monitored folder
- Host: GitHub
- URL: https://github.com/programie/folderactions
- Owner: Programie
- Created: 2024-02-02T12:54:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-02T21:37:11.000Z (over 2 years ago)
- Last Synced: 2026-07-21T12:33:54.968Z (19 days ago)
- Language: Python
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Folder Actions
Folder Actions is a script which executes actions for files in a specific folder (like your downloads folder) and is able to move and sort them based on defined rules.
Each rule is a Python script defining a `Rule` class which then does whatever you want it to do.
At the heart, it uses [watchdog](https://pypi.org/project/watchdog/) to observe the specified directory and wait for events. Once a new file has been saved into the watched directory, the configured rules will be checked. If a rule matches, the rule will be executed for that file.
## Installation
* Clone this repository into any directory
* Install the requirements using pip: `pip install -r requirements.txt`
* Define your rules (see bellow)
* Execute `folder-actions.py watch /path/to/watch`
## Configuration
The main configuration is done using a file in YAML format. The configuration should be stored at `~/.config/folder-actions/config.yml`.
Take a look at the [example config.yml](examples/config.yml).
## Defining rules
The script looks into `~/.config/folder-actions/rules` and loads any Python script. Each script should contain a `Rule` class containing at least a `get_rules()` method returning a list of paths to match.
Take a look into the [examples](examples) folder for some example rule files as well as the [Rule class structure](examples/rule_structure.py).