Python codes to prepare REST MD inputs