If you pass None
as the first argument to to_csv()
the data will be returned as a string. From there it's an easy step to upload that to S3 in one go.
It should also be possible to pass a StringIO
object to to_csv()
, but using a string will be easier.