How do I setup triggers from python

Well, I know that the trigger itself is written in javascript.
But my question is how I can do the setup of the triggers from Python.