Can I use a Suricata IDS alert to trigger some python code?

The easiest might be to run your python code on the eve.json? Parsing it with python is fairly easy.