Python tools for Joplin (Hotfolder, PDF Preview, ToDo overview)

Some scripts I use to optimize my workflow in Joplin.

hotfolder.py

Monitor a folder an add the Files to Joplin as a Note.

Images and text (Mimetype text/plain ) are inserted directly into the note, other Files are added as attachment. For PDF Files a preview of the first page can be generated.

add_pdf_previews.py

Search for notes with a PDF attachment an create a preview of the first PDF Site and add this Preview to Note.

todo_overview.py

Creates or Updates a note with a list of all open ToDo's. All to-dos that have been exceeded are marked with a :exclamation:.

JoplinWinBackup.au3

Since there is no possibility for an automatic backup under windows, the required key combinations are sent to joplin via autoit to create a backup.

10 Likes

It seems very nice, can you tell what is needed to use these scripts ?
I'm running Joplin on a OS X
I have python installed (pip3) and PymyPDF-1.18.0
I get "no module named click" error when trying todo_overview.py
Thank you for your help

I forgot to mention the click and request module.

Use pip to install them:

pip install click
pip install requests

I ran pip3 install click but I still get
No module named click
sorry for my ignorance in python, is python3 ok ?

Which python and pip version do you have?

python -V
pip -V

Python 2.7.16
pip 20.2.3 (using pip3 -V)

The error No module named click cams from pip3 install ?

yes

Hm I think you must upgrade python to version 3, because 2.7 is end of life.

ok I will try thank you

ok I need to enter python3 todo_overview.py -n "Todo" --title "Résumé" --tag "important"

thank you

Hello,

where should I put the git code ? In .config/Joplin ?

thank you for your help.

This plays no role. Just copy the folder joplin and the todo_overview.py, add_pdf_previews.py and hotfolder.py into any folder.

Than run for example python hotfolder.py -d "Import" -p "C:\JoplinImport"

1 Like

It works great. Maybe you should explain that if the note already exists it would replace it when using the script that search todos

Hello Jack,
thank you for your answer.
I run
python todo_overview.py --title "Open ToDo's" --as-todo --tag "importend"
into my Linux command line, but I got the following message :
File "todo_overview.py", line 6, in <module> from joplin import joplinapi ImportError: No module named joplin

I've the folder joplin and inside 2 files tools and api.

Do you have any idea of what is not well done on my side ?

thank you.

Your structure is the following?

SomeFolder
  |- joplin
  |     |- joplinapi.py
  |     |- joplintools.py
  |- todo_overview.py
  |- hotfolder.py 
  |- add_pdf_previews.py

Which python version do you have?

python -V

Hi,
yes I've the same structure.
image

To be sure that I run python 3 :
python3 todo_overview.py --title "Open ToDo's" --as-todo --tag "importend"
and I got :
Traceback (most recent call last): File "todo_overview.py", line 6, in <module> from joplin import joplinapi File "/home/.../Joplin/Joplin-Tools-master/joplin/joplinapi.py", line 8, in <module> from joplin import joplintools File "/home/bva/.../Joplin/Joplin-Tools-master/joplin/joplintools.py", line 1, in <module> import fitz ModuleNotFoundError: No module named 'fitz'

Thank you for your help.

Install the additional modules with pip install -r requirements.txt or the listed modules from the git page.

can this be made into a single executable?

Hi,

I run command pip3 install -r requirements.txt.
I get a error message : joplin/joplintools.py", line 1, in <module> import fitz ModuleNotFoundError: No module named 'fitz' So I install manually fitz pip3 install fitz`

When I run again python3 todo_overview.py --title "Open ToDo's" --as-todo --tag "importend"

I got this message :

Traceback (most recent call last): File "todo_overview.py", line 6, in <module> from joplin import joplinapi File "/home/xxx/Joplin/Joplin-Tools-master/joplin/joplinapi.py", line 8, in <module> from joplin import joplintools File "/home/xxx/Joplin/Joplin-Tools-master/joplin/joplintools.py", line 1, in <module> import fitz File "/home/xxx/.local/lib/python3.7/site-packages/fitz/__init__.py", line 1, in <module> from frontend import * ModuleNotFoundError: No module named 'frontend'
So I tried following pypi.org

pip install frontend

but I got this message :

Collecting frontend
Could not find a version that satisfies the requirement frontend (from versions: ) No matching distribution found for frontend

As I'm not very confortable with python, what could be your suggestion ?
Thank you for any help.