I did for ATRAP with IA/Deep Learning/robotic. See here IA, Python and Armory 3d/Blender
It’s a domain of endless possible improvments. You first need to be familiarised with maths/quaternions/mat4.
Considering your animation, you could improve it too using weight painting, for example in the joints to avoid collisions between the boxes.