New python API with example