implement rbsm reading in python