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

The installed module fritz is the wrong one! The correct one is PyMuPDF.

pip install PyMuPDF

possible, but not tested.

I tried to install PyMuPDF but it's not sucessfull.

my command is pip3 install PyMuPDF

And the answer is

Collecting PyMuPDF
Using cached https://files.pythonhosted.org/packages/80/f4/5830d068a860ee8d2cd91fb620bc74a501e04880c9ec02fa9dfc31de15e8/PyMuPDF-1.18.1.tar.gz
Building wheels for collected packages: PyMuPDF
Running setup.py bdist_wheel for PyMuPDF ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-gwbl4kyo/PyMuPDF/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-des71eyu --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/fitz
copying fitz/__init__.py -> build/lib.linux-x86_64-3.7/fitz
copying fitz/fitz.py -> build/lib.linux-x86_64-3.7/fitz
copying fitz/utils.py -> build/lib.linux-x86_64-3.7/fitz
copying fitz/__main__.py -> build/lib.linux-x86_64-3.7/fitz
running build_ext
building 'fitz._fitz' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/fitz
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/mupdf -I/usr/local/include/mupdf -Imupdf/thirdparty/freetype/include -I/usr/include/python3.7m -c fitz/fitz_wrap.c -o build/temp.linux-x86_64-3.7/fitz/fitz_wrap.o
fitz/fitz_wrap.c:2734:10: fatal error: fitz.h: Aucun fichier ou dossier de ce type
#include <fitz.h>
^~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

It seem there is a bug identify with PyMuPDF install. I'll check and come back later.
Thank

Hi,

I solve my problem by downloading PyMuPDF after installing MuPDF (is-it really needed ????) from this site this one and installing it after.

Then I should find the API Token :
sqlite3 ~/.config/joplin-desktop/database.sqlite 'select * from settings where key="api.token";'
Take care with directory : joplin or joplin-desktop.
Token is stored on the file joplin.json

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

Thanks for help

Nice to hear :slight_smile:
You can also find the token in the Joplin GUI under the Web Clipper options!

Yes, it is used to create the previews for PDF files.

Hi,

do you think it's possible to add python command line python todo_overview.py --title "A faire" --as-todo --tag "important" -n "A faire"
within tools menu ?

Ok good to say it

No, not possible. Eventually with the new plugin options.

I start the script every 5 Minutes with a scheduler / cron job to update my overview.

good idea, thanks a lot.

I also uploaded my AutoIt script for my automatic Joplin backups under windows.

I have added a new script note_overview.py to create note overviews from a search.
python note_overview.py --query "tag:project_xyz" -n Project_XYZ --title "Project Overview XYZ" --tag "!"

2 Likes