Generic event generator and handler api written in python