Assuming we are not able to manipulate the file directly with the available options from pandas as seems to be the case. Need to intercept the file and write to memory rather than disk. See 'You can ...