This simple script uses the module joplinexport
to export all the notes from a specific notebook in your Joplin instance.
You'll need a working instance of Joplin, running locally on your machine.
You also need your Joplin token, which you can find from the Desktop under Settings/Web Clipper Advanced Options
.
Save the token in the file .env
in your current directory
JOPLIN_TOKEN=yourlongtoken
Create and activate a new virtual environment and add the appropriate dependencies.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
To download all notes from the Joplin notebook "MyNoteBook"
python jopchop.py "MyNoteBook"
There is also a standalone version if you prefer not to deal with Python
Jopchop "MyNotebook"
Everything, including any resources associated with the note, will be downloaded to the directory downloads
You can also use joplinexport
as a Python module that you can load into your own packages. The script notes_script.py
shows how to do this.
The key functions are
notebook_handling.export_notebook(notebook_name) # download a notebook with this name and save it to the downloads folder
from .joplin_api import get_note_resources # use the Joplin API to get resources for a note
The core functions are based on the Joplin REST API.