@@ -45,12 +45,11 @@ Please note:
4545Support the project
4646================================================================================
4747
48- If your company has embedded pyexcel and its components into a revenue generating
49- product, please support me on github, or `patreon <https://www.patreon.com/bePatron?u=5537627 >`_
50- maintain the project and develop it further.
51-
52- With your financial support, I will be able to invest a little bit more time in coding,
53- documentation and writing interesting posts.
48+ If your company uses pyexcel and its components in a revenue-generating product,
49+ please consider supporting the project on GitHub or
50+ `Patreon <https://www.patreon.com/bePatron?u=5537627 >`_. Your financial
51+ support will enable me to dedicate more time to coding, improving documentation,
52+ and creating engaging content.
5453
5554
5655Known constraints
@@ -90,15 +89,8 @@ As a standalone library
9089
9190 >>> import os
9291 >>> import sys
93- >>> if sys.version_info[0 ] < 3 :
94- ... from StringIO import StringIO
95- ... else :
96- ... from io import BytesIO as StringIO
97- >>> PY2 = sys.version_info[0 ] == 2
98- >>> if PY2 and sys.version_info[1 ] < 7 :
99- ... from ordereddict import OrderedDict
100- ... else :
101- ... from collections import OrderedDict
92+ >>> from io import BytesIO
93+ >>> from collections import OrderedDict
10294
10395
10496Write to an xlsx file
@@ -142,7 +134,7 @@ Here's the sample code to write a dictionary to an xlsx file:
142134 >> > data = OrderedDict()
143135 >> > data.update({" Sheet 1" : [[1 , 2 , 3 ], [4 , 5 , 6 ]]})
144136 >> > data.update({" Sheet 2" : [[7 , 8 , 9 ], [10 , 11 , 12 ]]})
145- >> > io = StringIO ()
137+ >> > io = BytesIO ()
146138 >> > save_data(io, data)
147139 >> > # do something with the io
148140 >> > # In reality, you might give it to your http response
@@ -288,18 +280,18 @@ You got to wrap the binary content with stream to get xlsx working:
288280 + ------ -+ ------ -+ ------ -+
289281
290282
291- Writing to a StringIO instance
283+ Writing to a BytesIO instance
292284********************************************************************************
293285
294- You need to pass a StringIO instance to Writer:
286+ You need to pass a BytesIO instance to Writer:
295287
296288.. code-block :: python
297289
298290 >> > data = [
299291 ... [1 , 2 , 3 ],
300292 ... [4 , 5 , 6 ]
301293 ... ]
302- >> > io = StringIO ()
294+ >> > io = BytesIO ()
303295 >> > sheet = pe.Sheet(data)
304296 >> > io = sheet.save_to_memory(" xlsx" , io)
305297 >> > # then do something with io
0 commit comments