Python interface for SM langauge