Octoprint as embeded program on my python program

can i use octoprint as a embeded program or as a library on my python program to control my 5 axis robot with mks(or other ...) board by commands .i have my gui and python program that controls my machine , i want to control machine motion side (5 axis) with octo print by sending gcodes , thanks in advance

first i was looking to control axises by arduino board , my python program runs on raspberry pi , i connected my arduino to raspi by serial port and sending move commands to arduino , but as you know controling 5 axis with arduino was not a good idea .