import io
import csv
output = io.StringIO()
csvdata = [1,2,'abc market','hi everyone','common']
writer = csv.writer(output,quoting=csv.QUOTE_NONNUMERIC)
writer.writerow(csvdata)

print(type(output.getvalue()))
print(output.getvalue())

result

#str

#1,2,"abc market","hi everyone","common"