The StringIO module should be good for this.
Easy enough to encode the dataset into a csv string. The issue may be when you pull it back out and need the original data types.
The attached window strives to overcome that.
CSV Strings_2017-06-27_1053.proj (44.7 KB)
Hopefully, this will give you some ideas.