Joppy: Joplin Client and Server API Wrapper in Python

Since I hijacked a few other threads, like the predecessor, it's probably more appropriate to create a dedicated thread.

joppy supports basically two use cases. For more details, see the Github readme. In both cases, it can be installed by pip install joppy.

Joplin Client API

Requires a running Joplin client including web clipper. Functions from Joplin's data API are supported.

Example:

from joppy.client_api import ClientApi

# Create a new Api instance.
api = ClientApi(token=YOUR_TOKEN)

# Get all notes. Note that this method calls get_notes() multiple times to assemble the unpaginated result.
notes = api.get_all_notes()

Joplin Server API

There were some questions about a server API:

This is an attempt to build a wrapper that's working and sufficient for my needs. It is still experimental: Make a backup of your data before using. I can't provide any help at sync issues or lost data.

Supported: Some reverse engineered functions with similar interface like the client API.

Not supported:

  • Encryption
  • Some functions that were either to complex or I simply didn't need.

Example (requires a running Joplin server):

from joppy.server_api import ServerApi

# Create a new Api instance.
api = ServerApi(user="admin@localhost", password="admin", url="http://localhost:22300")

# Acquire a sync lock.
with api.sync_lock():

    # Add a notebook.
    notebook_id = api.add_notebook(title="My first notebook")

    # Add a note in the previously created notebook.
    note_id = api.add_note(title="My first note", body="With some content", parent_id=notebook_id)

NB: The server API wrapper might be superseded by the stand-alone sync API GSoC project.

1 Like