Sample Python scripts that can be invoked from Laserfiche workflow or business process.
Scripts are invoked by Laserfiche Remote Agent which is a service installed on a Windows PC for this purpose.
- Python 3.6 or later
- If your windows login user is different than the user running the remote agent, you need to install Python for all users.
- Visual Studio Code v1.80 or later
- A Laserfiche Cloud Account
- Creating a Python Script Documentation
This project is using a mono-repo structure with multiple packages. Please refer to the documentation for more details.
- Clone this GIT repository
- Install:
pip install -r requirements.txt
- Test:
pytest
-
Copy the whole repo into the remote agent folder
- e.g.,
C:\Program Files\Laserfiche\Server\RemoteAgent\ScriptRunner\Python\lf-sample-python-script-rules
- e.g.,
-
Add the destination folder into the PYTHONPATH environment variable
- if your windows login user is different than the user running the remote agent, you need to add the environment variable to
System variables
. -
import os os.environ['PYTHONPATH'] = r'C:\Program Files\Laserfiche\Server\RemoteAgent\ScriptRunner\Python\lf-sample-python-script-rules'
- if your windows login user is different than the user running the remote agent, you need to add the environment variable to
-
Install dependencies:
pip install -r requirements.txt
- If your windows login user is different than the user running the remote agent, you need to make
pip install
to install dependencies for all the user. - e.g,
pip install --target="C:\Program Files\Python312\Lib\site-packages" -r requirements.txt
- Please update the
--target
based on your python installation folder.
- If your windows login user is different than the user running the remote agent, you need to make