ECA rule engine in python