Python API consists from 3 different projects: developer-addon, serverside-rpc and client-rpc (last 2 are in the same gitlab repository that called l1-api-rpc)
This project is UI interface for Python API. It includes:
-
Python code editor
-
Examples of existing addons in resource folder
-
Mechanism for building
${your-addon-name}.jar(the actual
python-api.jaris build in this project)
This project is server part of rpc communication between ${your-addon-name}.jar and
python in runtime. It includes:
-
Income event handler
-
Outcome event handler
-
Mechanism to communicate with Bookmap core and with python in runtime
(to build and test your changes you should build
serverside-rpc.jarin appropriate project and put it into resources folder in developer-addon project and build the last one intopython-api-${version}.jar. If you want to build unobfuscated .jar then you should specify filename inDefaultBuildService#build())
To develop Python API addon you should clone l1-api-rpc and developer-addon to your local machine. Notice that to you shouldn't open full l1-api-rpc like a project in IntelliJ IDEA rather you should open folder serverside-rpc as a project (IDEA can't open such projects that consists of 2 parts properly)
Python Api based on rpc. Workflow has next core events:
- Create addon using python
- Build addon into
.jar - Run
.jarand python code simultaneously
The .jar is some kind of connector between python code and core. It handles all calls from python
and sends it to core by using Bookmap API as well it handles all events from core and sends it to python.