This is my approach for automating Paperless-ngx.
Goal is to use these as Post-Processing Scripts.
Python 3 with version >= 3.11 has to be installed and has to be runnable by python3.
The virtual Environment need to be setup in your installation folder: <installation folder>/.venv.
Test if the virtual environment is setup properly acivate it and check, if the python version is >= 3.11:
$ cd <installation folder>
$ source .venv/bin/activate
(.venv) $ python3 --version
Python 3.13.1
Prerequisites for the installation script:
unzipjq
For debian/ubuntu:
apt-get install unzip jq
Use this bash command to install the latest release.
bash -c "$(wget -qLO - https://github.com/keineantwort/PaperlessAutomation/raw/main/install.sh)"
After Installation proceed with the configuration as stated below.
Just download this repo at your paperless-ngx machine. Make sure post_consumption.sh is executable for the
user used by paperless.
After Installation proceed with the configuration as stated below.
Use post_consumption.sh as post conumption script.
i.e.: /etc/paperless.conf
...
PAPERLESS_PRE_CONSUME_SCRIPT="/var/opt/PaperlessAutomation/post_consumption.sh"
...
You can test you installation with this script:
$ export DOCUMENT_ID=<existing document>; ./pa/post_consumption.sh
The file launcher.yaml contains the configuration for the Post-Consumption script:
credentials:
url: "<YOUR PAPERLESS URL>"
api_token: "<YOUR TOKEN>"
postconsumption:
- <LIST OF MODULES>
- ttcf
Just start the main.py File with a launcher.yaml config file right next to it.
There are two kinds of Modules: Helper and Automation
Automation modules do the work.
They contain a main.py file which is the starting point for this module. And they use a YAML for
configuration. The YAML is named like module_name.yaml.
TagsToCustomFields automates the conversion from tags to values of a dropdown CustomField.
Helper modules are not ment to be used on its own. They are supporting the Automation modules.
PaperlessAccess provides the general access to paperless.
- Paperless API for Paperless access
- PyYAML - for reading configuration files
This project is being developed under the terms of the Apache License, Version 2.0.