Help in coding with python using apm 2.6


Currently, I’m working on a project that aims to make the quadcopter land autonomously on a moving vehicle. For that purpose, I need to use Python as I need some machine vision algorithms. Meanwhile, I want to control the quadcopter using the ardupilot built in libraries. How can this be possible. I could reach to an option, which is to connect a raspberry pi with the apm, thus, raspberry pi and apm 2.6 can communicate with each other by MAVlink commands. Are there other options to do so. I mean to control the quadcopter by coding in Python. Thank you very much in advance. Waiting for your response