@@ -8,16 +8,14 @@ pyexcel-ods - Let you focus on data, instead of ods format
8
8
.. image :: https://raw.githubusercontent.com/pyexcel/pyexcel-mobans/master/images/awesome-badge.svg
9
9
:target: https://awesome-python.com/#specific-formats-processing
10
10
11
- .. image :: https://github.com/pyexcel/pyexcel-ods/workflows/run_tests/badge.svg
12
- :target: http://github.com/pyexcel/pyexcel-ods/actions
13
-
14
11
.. image :: https://codecov.io/gh/pyexcel/pyexcel-ods/branch/master/graph/badge.svg
15
12
:target: https://codecov.io/gh/pyexcel/pyexcel-ods
16
13
17
14
.. image :: https://badge.fury.io/py/pyexcel-ods.svg
18
15
:target: https://pypi.org/project/pyexcel-ods
19
16
20
17
18
+
21
19
.. image :: https://pepy.tech/badge/pyexcel-ods/month
22
20
:target: https://pepy.tech/project/pyexcel-ods
23
21
@@ -41,19 +39,11 @@ is the other sister library that has no external dependency but do ods reading o
41
39
Support the project
42
40
================================================================================
43
41
44
- If your company has embedded pyexcel and its components into a revenue generating
45
- product, please support me on github, `patreon <https://www.patreon.com/bePatron?u=5537627 >`_
46
- or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel >`_ to maintain
47
- the project and develop it further.
48
-
49
- If you are an individual, you are welcome to support me too and for however long
50
- you feel like. As my backer, you will receive
51
- `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts >`_.
52
-
53
- And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user `.
54
-
55
- With your financial support, I will be able to invest
56
- a little bit more time in coding, documentation and writing interesting posts.
42
+ If your company uses pyexcel and its components in a revenue-generating product,
43
+ please consider supporting the project on GitHub or
44
+ `Patreon <https://www.patreon.com/bePatron?u=5537627 >`_. Your financial
45
+ support will enable me to dedicate more time to coding, improving documentation,
46
+ and creating engaging content.
57
47
58
48
59
49
Known constraints
@@ -93,15 +83,8 @@ As a standalone library
93
83
94
84
>>> import os
95
85
>>> import sys
96
- >>> if sys.version_info[0 ] < 3 :
97
- ... from StringIO import StringIO
98
- ... else :
99
- ... from io import BytesIO as StringIO
100
- >>> PY2 = sys.version_info[0 ] == 2
101
- >>> if PY2 and sys.version_info[1 ] < 7 :
102
- ... from ordereddict import OrderedDict
103
- ... else :
104
- ... from collections import OrderedDict
86
+ >>> from io import BytesIO
87
+ >>> from collections import OrderedDict
105
88
106
89
107
90
Write to an ods file
@@ -145,7 +128,7 @@ Here's the sample code to write a dictionary to an ods file:
145
128
>> > data = OrderedDict()
146
129
>> > data.update({" Sheet 1" : [[1 , 2 , 3 ], [4 , 5 , 6 ]]})
147
130
>> > data.update({" Sheet 2" : [[7 , 8 , 9 ], [10 , 11 , 12 ]]})
148
- >> > io = StringIO ()
131
+ >> > io = BytesIO ()
149
132
>> > save_data(io, data)
150
133
>> > # do something with the io
151
134
>> > # In reality, you might give it to your http response
@@ -297,18 +280,18 @@ You got to wrap the binary content with stream to get ods working:
297
280
+ ------ -+ ------ -+ ------ -+
298
281
299
282
300
- Writing to a StringIO instance
283
+ Writing to a BytesIO instance
301
284
********************************************************************************
302
285
303
- You need to pass a StringIO instance to Writer:
286
+ You need to pass a BytesIO instance to Writer:
304
287
305
288
.. code-block :: python
306
289
307
290
>> > data = [
308
291
... [1 , 2 , 3 ],
309
292
... [4 , 5 , 6 ]
310
293
... ]
311
- >> > io = StringIO ()
294
+ >> > io = BytesIO ()
312
295
>> > sheet = pe.Sheet(data)
313
296
>> > io = sheet.save_to_memory(" ods" , io)
314
297
>> > # then do something with io
@@ -340,26 +323,29 @@ Then install relevant development requirements:
340
323
#. pip install -r tests/requirements.txt
341
324
342
325
Once you have finished your changes, please provide test case(s), relevant documentation
343
- and update CHANGELOG.rst.
326
+ and update changelog.yml
344
327
345
328
.. note ::
346
329
347
330
As to rnd_requirements.txt, usually, it is created when a dependent
348
- library is not released. Once the dependecy is installed
331
+ library is not released. Once the dependency is installed
349
332
(will be released), the future
350
333
version of the dependency in the requirements.txt will be valid.
351
334
352
335
353
336
How to test your contribution
354
- ------------------------------
337
+ --------------------------------------------------------------------------------
355
338
356
- Although `pytest ` and `doctest ` are both used in code testing, it is adviable that unit tests are put in tests. `doctest ` is incorporated only to make sure the code examples in documentation remain valid across different development releases.
339
+ Although `nose ` and `doctest ` are both used in code testing, it is advisable
340
+ that unit tests are put in tests. `doctest ` is incorporated only to make sure
341
+ the code examples in documentation remain valid across different development
342
+ releases.
357
343
358
344
On Linux/Unix systems, please launch your tests like this::
359
345
360
346
$ make
361
347
362
- On Windows systems , please issue this command::
348
+ On Windows, please issue this command::
363
349
364
350
> test.bat
365
351
@@ -371,7 +357,7 @@ Please run::
371
357
372
358
$ make format
373
359
374
- so as to beautify your code otherwise travis-ci may fail your unit test.
360
+ so as to beautify your code otherwise your build may fail your unit test.
375
361
376
362
377
363
Credits
0 commit comments