How to receive KODI notifications with a Python script?



How to receive KODI notifications with a Python script?

Kodi 18.7 runs under Raspbian 10 (Buster) on a Raspbeery 4. The Phython 3.7 script runs as a service.

Sent from the script, the KODI can already respond to various commands, such as Player.PlayPause, Player.Stop or Player.GoTo.
In addition, the operating status should also be displayed with LEDs that are already connected. For this purpose, notifications such as Player.OnPlay or Player.OnStop must be responded to.
Since I couldn’t find any useful information on the net regarding the approach, I asked ChatGPT about this. I got the answer that I should use pip install kodi-jsonrpc and a few lines of code, which looked very plausible. But unfortunately the server was not reachable (Error 404). pip install kodijsonrpc was successful, but the documentation on GitHub is too poor for me.

So, what is the right approach here?