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

**URL:** <https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732>\
**Category:** Apps\
**Created:** [16 October 2020 04:51 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732 "2020-10-16T04:51:12Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [22 October 2020 10:46 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/21 "2020-10-22T10:46:29Z")

</div>

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

```auto
pip install PyMuPDF

```

---

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [22 October 2020 10:47 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/22 "2020-10-22T10:47:54Z")

</div>

possible, but not tested.

---

<div class="post-metadata">

**Author:** ![bva](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bva](https://discourse.joplinapp.org/u/bva)\
**Post date:** [22 October 2020 13:23 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/23 "2020-10-22T13:23:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bva](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bva](https://discourse.joplinapp.org/u/bva)\
**Post date:** [23 October 2020 08:37 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/24 "2020-10-23T08:37:00Z")

</div>

Hi,

I solve my problem by downloading PyMuPDF after installing MuPDF (is-it really needed ????) from this site [this one](https://pypi.org/project/PyMuPDF/) 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

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

```

Thanks for help

---

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [23 October 2020 08:50 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/25 "2020-10-23T08:50:55Z")

</div>

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

> [@bva](#):
>
> MuPDF (is-it really needed ????)

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

---

<div class="post-metadata">

**Author:** ![bva](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bva](https://discourse.joplinapp.org/u/bva)\
**Post date:** [23 October 2020 08:51 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/26 "2020-10-23T08:51:35Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![bva](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bva](https://discourse.joplinapp.org/u/bva)\
**Post date:** [23 October 2020 08:53 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/27 "2020-10-23T08:53:05Z")

</div>

> [@JackGruber](#):
>
> You can also find the token in the Joplin GUI under the Web Clipper options!

Ok good to say it

---

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [23 October 2020 08:54 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/28 "2020-10-23T08:54:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bva](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bva](https://discourse.joplinapp.org/u/bva)\
**Post date:** [23 October 2020 08:56 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/29 "2020-10-23T08:56:30Z")

</div>

> [@JackGruber](#):
>
> I start the script every 5 Minutes with a scheduler / cron job to update my overview.

good idea, thanks a lot.

---

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [23 October 2020 13:32 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/30 "2020-10-23T13:32:24Z")

</div>

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

> **[JackGruber/Joplin-Tools](https://github.com/JackGruber/Joplin-Tools#JoplinWinBackupau3)**
>
> Various Python tools for Joplin. (Hotfolder, PDF Previews, ToDo List). - JackGruber/Joplin-Tools

---

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [26 December 2020 15:50 UTC](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732/31 "2020-12-26T15:50:43Z")

</div>

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 "!"`

 ![grafik](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/4/4b13c0f58f45d1bd945e4b8000587d3a307d49de.png)

[Previous page](https://discourse.joplinapp.org/t/python-tools-for-joplin-hotfolder-pdf-preview-todo-overview/11732.md?page=1)
