Codebase list pyexcel-ods / 04e99c4
Import upstream version 0.6.0 Kali Janitor 3 years ago
23 changed file(s) with 432 addition(s) and 539 deletion(s). Raw diff Collapse all Expand all
00 Change log
11 ================================================================================
22
3 0.6.0 - 9.10.2020
4 --------------------------------------------------------------------------------
5
6 **added**
7
8 #. new style reader and writer plugins. works with pyexcel-io v0.6.2
9
310 0.5.6 - 19.03.2019
411 --------------------------------------------------------------------------------
512
6 added
7 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 **added**
814
915 #. `#32 <https://github.com/pyexcel/pyexcel-ods/issues/32>`_, fix odfpy pinning
1016 #. `#33 <https://github.com/pyexcel/pyexcel-ods/issues/33>`_, fix
1319 0.5.5 - 16.03.2019
1420 --------------------------------------------------------------------------------
1521
16 added
17 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 **added**
1823
1924 #. `#32 <https://github.com/pyexcel/pyexcel-ods/issues/32>`_, fix odfpy pinning
2025
2126 0.5.4 - 27.11.2018
2227 --------------------------------------------------------------------------------
2328
24 added
25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 **added**
2630
2731 #. `#30 <https://github.com/pyexcel/pyexcel-ods/issues/30>`_, long type will not
2832 be written in ods. please use string type. And if the integer is equal or
3236 0.5.3 - unreleased
3337 --------------------------------------------------------------------------------
3438
35 added
36 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 **added**
3740
3841 #. `#24 <https://github.com/pyexcel/pyexcel-ods/issues/24>`_, ignore
3942 comments(<office:comment>) in cell
4447 0.5.2 - 23.10.2017
4548 --------------------------------------------------------------------------------
4649
47 updated
48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50 **updated**
4951
5052 #. pyexcel `pyexcel#105 <https://github.com/pyexcel/pyexcel/issues/105>`_,
5153 remove gease from setup_requires, introduced by 0.5.1.
5456 0.5.1 - 20.10.2017
5557 --------------------------------------------------------------------------------
5658
57 added
58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59 **added**
5960
6061 #. `pyexcel#103 <https://github.com/pyexcel/pyexcel/issues/103>`_, include
6162 LICENSE file in MANIFEST.in, meaning LICENSE file will appear in the released
6465 0.5.0 - 30.08.2017
6566 --------------------------------------------------------------------------------
6667
67 Updated
68 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68 **Updated**
6969
7070 #. put dependency on pyexcel-io 0.5.0, which uses cStringIO instead of StringIO.
7171 Hence, there will be performance boost in handling files in memory.
7272
73 Relocated
74 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73 **Relocated**
7574
7675 #. All ods type conversion code lives in pyexcel_io.service module
7776
7877 0.4.1 - 25.08.2017
7978 --------------------------------------------------------------------------------
8079
81 Updated
82 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80 **Updated**
8381
8482 #. `pyexcel#23 <https://github.com/pyexcel/pyexcel/issues/23>`_, handle
8583 unseekable stream given by http response
8987 0.4.0 - 19.06.2017
9088 --------------------------------------------------------------------------------
9189
92 Updated
93 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90 **Updated**
9491
9592 #. `pyexcel#14 <https://github.com/pyexcel/pyexcel/issues/14>`_, close file
9693 handle
10097 0.3.3 - 07.05.2017
10198 --------------------------------------------------------------------------------
10299
103 Updated
104 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 **Updated**
105101
106102 #. issue `pyexcel#19 <https://github.com/pyexcel/pyexcel/issues/19>`_, not all
107103 texts in a multi-node cell were extracted.
109105 0.3.2 - 13.04.2017
110106 --------------------------------------------------------------------------------
111107
112 Updated
113 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108 **Updated**
114109
115110 #. issue `pyexcel#17 <https://github.com/pyexcel/pyexcel/issues/17>`_, empty new
116111 line is ignored
120115 0.3.1 - 02.02.2017
121116 --------------------------------------------------------------------------------
122117
123 Added
124 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
118 **Added**
125119
126120 #. Recognize currency type
127121
128122 0.3.0 - 22.12.2016
129123 --------------------------------------------------------------------------------
130124
131 Updated
132 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125 **Updated**
133126
134127 #. Code refactoring with pyexcel-io v 0.3.0
135128
136129 0.2.2 - 24.10.2016
137130 --------------------------------------------------------------------------------
138131
139 Updated
140 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132 **Updated**
141133
142134 #. issue `pyexcel#14 <https://github.com/pyexcel/pyexcel/issues/14>`_, index
143135 error when reading a ods file that has non-uniform columns repeated property.
145137 0.2.1 - 31.08.2016
146138 --------------------------------------------------------------------------------
147139
148 Added
149 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140 **Added**
150141
151142 #. support pagination. two pairs: start_row, row_limit and start_column,
152143 column_limit help you deal with large files.
155146 0.2.0 - 01.06.2016
156147 --------------------------------------------------------------------------------
157148
158 Added
159 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149 **Added**
160150
161151 #. By default, `float` will be converted to `int` where fits. `auto_detect_int`,
162152 a flag to switch off the autoatic conversion from `float` to `int`.
163153 #. 'library=pyexcel-ods' was added so as to inform pyexcel to use it instead of
164154 other libraries, in the situation where multiple plugins were installed.
165155
166 Updated
167 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156 **Updated**
168157
169158 #. support the auto-import feature of pyexcel-io 0.2.0
170159
171160 0.1.1 - 30.01.2016
172161 --------------------------------------------------------------------------------
173162
174 Added
175 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163 **Added**
176164
177165 #. 'streaming' is an extra option given to get_data. Only when 'streaming' is
178166 explicitly set to True, the data will be consisted of generators, hence will
181169 #. support multi-line text cell #5
182170 #. feature migration from pyexcel-ods3 pyexcel/pyexcel-ods3#5
183171
184 Updated
185 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172 **Updated**
186173
187174 #. compatibility with pyexcel-io 0.1.1
188175
189176 0.0.12 - 10.10.2015
190177 --------------------------------------------------------------------------------
191178
192 Updated
193 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179 **Updated**
194180
195181 #. Bug fix: excessive trailing columns with empty values
196182
197183 0.0.11 - 26.09.2015
198184 --------------------------------------------------------------------------------
199185
200 Updated
201 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186 **Updated**
202187
203188 #. Complete fix for libreoffice datetime field
204189
205190 0.0.10 - 15.09.2015
206191 --------------------------------------------------------------------------------
207192
208 Updated
209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 **Updated**
210194
211195 #. Bug fix: date field could have datetime from libreoffice
212196
213197 0.0.9 - 21.08.2015
214198 --------------------------------------------------------------------------------
215199
216 Updated
217 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200 **Updated**
218201
219202 #. Bug fix: utf-8 string throw unicode exceptions
220203
221204 0.0.8 - 28.06.2015
222205 --------------------------------------------------------------------------------
223206
224 Updated
225 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
207 **Updated**
226208
227209 #. Pin dependency odfpy 0.9.6 to avoid buggy odfpy 1.3.0
228210
229211 0.0.7 - 28.05.2015
230212 --------------------------------------------------------------------------------
231213
232 Updated
233 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
214 **Updated**
234215
235216 #. Bug fix: "number-columns-repeated" is now respected
236217
237218 0.0.6 - 21.05.2015
238219 --------------------------------------------------------------------------------
239220
240 Updated
241 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221 **Updated**
242222
243223 #. get_data and save_data are seen across pyexcel-* extensions. remember them
244224 once and use them across all extensions.
246226 0.0.5 - 22.02.2015
247227 --------------------------------------------------------------------------------
248228
249 Added
250 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
229 **Added**
251230
252231 #. Loads only one sheet from a multiple sheet book
253232 #. Use New BSD License
255234 0.0.4 - 14.12.2014
256235 --------------------------------------------------------------------------------
257236
258 Updated
259 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237 **Updated**
260238
261239 #. IO interface update as pyexcel-io introduced keywords.
262240 #. initial release
264242 0.0.3 - 08.12.2014
265243 --------------------------------------------------------------------------------
266244
267 Updated
268 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245 **Updated**
269246
270247 #. IO interface update as pyexcel-io introduced keywords.
271248 #. initial release
0
1
2 3 contributors
3 ================================================================================
4
5 In alphabetical order:
6
7 * `Azamat H. Hackimov <https://github.com/winterheart>`_
8 * `John Vandenberg <https://github.com/jayvdb>`_
9 * `Mateusz Konieczny <https://github.com/matkoniecz>`_
0 Copyright (c) 2015-2019 by Onni Software Ltd. and its contributors
0 Copyright (c) 2015-2020 by Onni Software Ltd. and its contributors
11 All rights reserved.
22
33 Redistribution and use in source and binary forms of the software as well
1212 and/or other materials provided with the distribution.
1313
1414 * Neither the name of 'pyexcel-ods' nor the names of the contributors
15 may be used to endorse or promote products derived from this software
15 may not be used to endorse or promote products derived from this software
1616 without specific prior written permission.
1717
1818 THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
00 include README.rst
11 include LICENSE
22 include CHANGELOG.rst
3 include CONTRIBUTORS.rst
34 recursive-include tests *
45 recursive-include docs *
0 Metadata-Version: 1.1
0 Metadata-Version: 1.2
11 Name: pyexcel-ods
2 Version: 0.5.6
2 Version: 0.6.0
33 Summary: A wrapper library to read, manipulate and write data in ods format
44 Home-page: https://github.com/pyexcel/pyexcel-ods
5 Author: C.W.
6 Author-email: [email protected]
5 Author: chfw
6 Author-email: [email protected]
77 License: New BSD
8 Download-URL: https://github.com/pyexcel/pyexcel-ods/archive/0.5.6.tar.gz
8 Download-URL: https://github.com/pyexcel/pyexcel-ods/archive/0.6.0.tar.gz
99 Description: ================================================================================
1010 pyexcel-ods - Let you focus on data, instead of ods format
1111 ================================================================================
1212
1313 .. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png
14 :target: https://www.patreon.com/pyexcel
15
16 .. image:: https://api.bountysource.com/badge/team?team_id=288537
17 :target: https://salt.bountysource.com/teams/chfw-pyexcel
14 :target: https://www.patreon.com/chfw
15
16 .. image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
17 :target: https://awesome-python.com/#specific-formats-processing
1818
1919 .. image:: https://travis-ci.org/pyexcel/pyexcel-ods.svg?branch=master
2020 :target: http://travis-ci.org/pyexcel/pyexcel-ods
2222 .. image:: https://codecov.io/gh/pyexcel/pyexcel-ods/branch/master/graph/badge.svg
2323 :target: https://codecov.io/gh/pyexcel/pyexcel-ods
2424
25 .. image:: https://badge.fury.io/py/pyexcel-ods.svg
26 :target: https://pypi.org/project/pyexcel-ods
27
28
29 .. image:: https://pepy.tech/badge/pyexcel-ods/month
30 :target: https://pepy.tech/project/pyexcel-ods/month
31
32
2533 .. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
2634 :target: https://gitter.im/pyexcel/Lobby
2735
36 .. image:: https://img.shields.io/static/v1?label=continuous%20templating&message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0&color=blue&style=flat-square
37 :target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects
38
39 .. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
40 :target: https://github.com/psf/black
2841
2942 **pyexcel-ods** is a tiny wrapper library to read, manipulate and write data in
3043 ods format using python 2.6 and python 2.7. You are likely to use it with
3346 depends on ezodf and lxml. `pyexcel-odsr <https://github.com/pyexcel/pyexcel-odsr>`_
3447 is the other sister library that has no external dependency but do ods reading only
3548
49 Support the project
50 ================================================================================
51
52 If your company has embedded pyexcel and its components into a revenue generating
53 product, please support me on github, `patreon <https://www.patreon.com/bePatron?u=5537627>`_
54 or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
55 the project and develop it further.
56
57 If you are an individual, you are welcome to support me too and for however long
58 you feel like. As my backer, you will receive
59 `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
60
61 And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
62
63 With your financial support, I will be able to invest
64 a little bit more time in coding, documentation and writing interesting posts.
65
66
3667 Known constraints
3768 ==================
3869
5687 $ git clone https://github.com/pyexcel/pyexcel-ods.git
5788 $ cd pyexcel-ods
5889 $ python setup.py install
59
60 Support the project
61 ================================================================================
62
63 If your company has embedded pyexcel and its components into a revenue generating
64 product, please support me on `patreon <https://www.patreon.com/bePatron?u=5537627>`_
65 or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
66 the project and develop it further.
67
68 If you are an individual, you are welcome to support me too and for however long
69 you feel like. As my backer, you will receive
70 `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
71
72 And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
73
74 With your financial support, I will be able to invest
75 a little bit more time in coding, documentation and writing interesting posts.
76
7790
7891 Usage
7992 ================================================================================
334347
335348 > test.bat
336349
337 How to update test environment and update documentation
338 ---------------------------------------------------------
339
340 Additional steps are required:
341
342 #. pip install moban
343 #. git clone https://github.com/moremoban/setupmobans.git # generic setup
344 #. git clone https://github.com/pyexcel/pyexcel-commons.git commons
345 #. make your changes in `.moban.d` directory, then issue command `moban`
346
347 What is pyexcel-commons
348 ---------------------------------
349
350 Many information that are shared across pyexcel projects, such as: this developer guide, license info, etc. are stored in `pyexcel-commons` project.
351
352 What is .moban.d
353 ---------------------------------
354
355 `.moban.d` stores the specific meta data for the library.
356
357 Acceptance criteria
358 -------------------
359
360 #. Has Test cases written
361 #. Has all code lines tested
362 #. Passes all Travis CI builds
363 #. Has fair amount of documentation if your change is complex
364 #. run 'make format' so as to confirm the pyexcel organisation's coding style
365 #. Please update CHANGELOG.rst
366 #. Please add yourself to CONTRIBUTORS.rst
367 #. Agree on NEW BSD License for your contribution
350
351 Before you commit
352 ------------------------------
353
354 Please run::
355
356 $ make format
357
358 so as to beautify your code otherwise travis-ci may fail your unit test.
359
368360
369361 Credits
370362 ================================================================================
375367 Change log
376368 ================================================================================
377369
370 0.6.0 - 9.10.2020
371 --------------------------------------------------------------------------------
372
373 **added**
374
375 #. new style reader and writer plugins. works with pyexcel-io v0.6.2
376
378377 0.5.6 - 19.03.2019
379378 --------------------------------------------------------------------------------
380379
381 added
382 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
380 **added**
383381
384382 #. `#32 <https://github.com/pyexcel/pyexcel-ods/issues/32>`_, fix odfpy pinning
385383 #. `#33 <https://github.com/pyexcel/pyexcel-ods/issues/33>`_, fix
388386 0.5.5 - 16.03.2019
389387 --------------------------------------------------------------------------------
390388
391 added
392 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
389 **added**
393390
394391 #. `#32 <https://github.com/pyexcel/pyexcel-ods/issues/32>`_, fix odfpy pinning
395392
396393 0.5.4 - 27.11.2018
397394 --------------------------------------------------------------------------------
398395
399 added
400 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
396 **added**
401397
402398 #. `#30 <https://github.com/pyexcel/pyexcel-ods/issues/30>`_, long type will not
403399 be written in ods. please use string type. And if the integer is equal or
407403 0.5.3 - unreleased
408404 --------------------------------------------------------------------------------
409405
410 added
411 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
406 **added**
412407
413408 #. `#24 <https://github.com/pyexcel/pyexcel-ods/issues/24>`_, ignore
414409 comments(<office:comment>) in cell
419414 0.5.2 - 23.10.2017
420415 --------------------------------------------------------------------------------
421416
422 updated
423 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
417 **updated**
424418
425419 #. pyexcel `pyexcel#105 <https://github.com/pyexcel/pyexcel/issues/105>`_,
426420 remove gease from setup_requires, introduced by 0.5.1.
429423 0.5.1 - 20.10.2017
430424 --------------------------------------------------------------------------------
431425
432 added
433 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
426 **added**
434427
435428 #. `pyexcel#103 <https://github.com/pyexcel/pyexcel/issues/103>`_, include
436429 LICENSE file in MANIFEST.in, meaning LICENSE file will appear in the released
439432 0.5.0 - 30.08.2017
440433 --------------------------------------------------------------------------------
441434
442 Updated
443 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
435 **Updated**
444436
445437 #. put dependency on pyexcel-io 0.5.0, which uses cStringIO instead of StringIO.
446438 Hence, there will be performance boost in handling files in memory.
447439
448 Relocated
449 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
440 **Relocated**
450441
451442 #. All ods type conversion code lives in pyexcel_io.service module
452443
453444 0.4.1 - 25.08.2017
454445 --------------------------------------------------------------------------------
455446
456 Updated
457 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
447 **Updated**
458448
459449 #. `pyexcel#23 <https://github.com/pyexcel/pyexcel/issues/23>`_, handle
460450 unseekable stream given by http response
464454 0.4.0 - 19.06.2017
465455 --------------------------------------------------------------------------------
466456
467 Updated
468 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
457 **Updated**
469458
470459 #. `pyexcel#14 <https://github.com/pyexcel/pyexcel/issues/14>`_, close file
471460 handle
475464 0.3.3 - 07.05.2017
476465 --------------------------------------------------------------------------------
477466
478 Updated
479 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
467 **Updated**
480468
481469 #. issue `pyexcel#19 <https://github.com/pyexcel/pyexcel/issues/19>`_, not all
482470 texts in a multi-node cell were extracted.
484472 0.3.2 - 13.04.2017
485473 --------------------------------------------------------------------------------
486474
487 Updated
488 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
475 **Updated**
489476
490477 #. issue `pyexcel#17 <https://github.com/pyexcel/pyexcel/issues/17>`_, empty new
491478 line is ignored
495482 0.3.1 - 02.02.2017
496483 --------------------------------------------------------------------------------
497484
498 Added
499 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
485 **Added**
500486
501487 #. Recognize currency type
502488
503489 0.3.0 - 22.12.2016
504490 --------------------------------------------------------------------------------
505491
506 Updated
507 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
492 **Updated**
508493
509494 #. Code refactoring with pyexcel-io v 0.3.0
510495
511496 0.2.2 - 24.10.2016
512497 --------------------------------------------------------------------------------
513498
514 Updated
515 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
499 **Updated**
516500
517501 #. issue `pyexcel#14 <https://github.com/pyexcel/pyexcel/issues/14>`_, index
518502 error when reading a ods file that has non-uniform columns repeated property.
520504 0.2.1 - 31.08.2016
521505 --------------------------------------------------------------------------------
522506
523 Added
524 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
507 **Added**
525508
526509 #. support pagination. two pairs: start_row, row_limit and start_column,
527510 column_limit help you deal with large files.
530513 0.2.0 - 01.06.2016
531514 --------------------------------------------------------------------------------
532515
533 Added
534 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
516 **Added**
535517
536518 #. By default, `float` will be converted to `int` where fits. `auto_detect_int`,
537519 a flag to switch off the autoatic conversion from `float` to `int`.
538520 #. 'library=pyexcel-ods' was added so as to inform pyexcel to use it instead of
539521 other libraries, in the situation where multiple plugins were installed.
540522
541 Updated
542 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
523 **Updated**
543524
544525 #. support the auto-import feature of pyexcel-io 0.2.0
545526
546527 0.1.1 - 30.01.2016
547528 --------------------------------------------------------------------------------
548529
549 Added
550 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 **Added**
551531
552532 #. 'streaming' is an extra option given to get_data. Only when 'streaming' is
553533 explicitly set to True, the data will be consisted of generators, hence will
556536 #. support multi-line text cell #5
557537 #. feature migration from pyexcel-ods3 pyexcel/pyexcel-ods3#5
558538
559 Updated
560 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
539 **Updated**
561540
562541 #. compatibility with pyexcel-io 0.1.1
563542
564543 0.0.12 - 10.10.2015
565544 --------------------------------------------------------------------------------
566545
567 Updated
568 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
546 **Updated**
569547
570548 #. Bug fix: excessive trailing columns with empty values
571549
572550 0.0.11 - 26.09.2015
573551 --------------------------------------------------------------------------------
574552
575 Updated
576 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
553 **Updated**
577554
578555 #. Complete fix for libreoffice datetime field
579556
580557 0.0.10 - 15.09.2015
581558 --------------------------------------------------------------------------------
582559
583 Updated
584 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
560 **Updated**
585561
586562 #. Bug fix: date field could have datetime from libreoffice
587563
588564 0.0.9 - 21.08.2015
589565 --------------------------------------------------------------------------------
590566
591 Updated
592 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
567 **Updated**
593568
594569 #. Bug fix: utf-8 string throw unicode exceptions
595570
596571 0.0.8 - 28.06.2015
597572 --------------------------------------------------------------------------------
598573
599 Updated
600 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
574 **Updated**
601575
602576 #. Pin dependency odfpy 0.9.6 to avoid buggy odfpy 1.3.0
603577
604578 0.0.7 - 28.05.2015
605579 --------------------------------------------------------------------------------
606580
607 Updated
608 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
581 **Updated**
609582
610583 #. Bug fix: "number-columns-repeated" is now respected
611584
612585 0.0.6 - 21.05.2015
613586 --------------------------------------------------------------------------------
614587
615 Updated
616 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
588 **Updated**
617589
618590 #. get_data and save_data are seen across pyexcel-* extensions. remember them
619591 once and use them across all extensions.
621593 0.0.5 - 22.02.2015
622594 --------------------------------------------------------------------------------
623595
624 Added
625 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
596 **Added**
626597
627598 #. Loads only one sheet from a multiple sheet book
628599 #. Use New BSD License
630601 0.0.4 - 14.12.2014
631602 --------------------------------------------------------------------------------
632603
633 Updated
634 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
604 **Updated**
635605
636606 #. IO interface update as pyexcel-io introduced keywords.
637607 #. initial release
639609 0.0.3 - 08.12.2014
640610 --------------------------------------------------------------------------------
641611
642 Updated
643 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
612 **Updated**
644613
645614 #. IO interface update as pyexcel-io introduced keywords.
646615 #. initial release
651620 Classifier: Topic :: Software Development :: Libraries
652621 Classifier: Programming Language :: Python
653622 Classifier: Intended Audience :: Developers
654 Classifier: Programming Language :: Python :: 2.6
655 Classifier: Programming Language :: Python :: 2.7
656 Classifier: Programming Language :: Python :: 3.3
657 Classifier: Programming Language :: Python :: 3.4
658 Classifier: Programming Language :: Python :: 3.5
623 Classifier: Programming Language :: Python :: 3 :: Only
659624 Classifier: Programming Language :: Python :: 3.6
625 Classifier: Programming Language :: Python :: 3.7
626 Classifier: Programming Language :: Python :: 3.8
627 Requires-Python: >=3.6
22 ================================================================================
33
44 .. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png
5 :target: https://www.patreon.com/pyexcel
6
7 .. image:: https://api.bountysource.com/badge/team?team_id=288537
8 :target: https://salt.bountysource.com/teams/chfw-pyexcel
5 :target: https://www.patreon.com/chfw
6
7 .. image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
8 :target: https://awesome-python.com/#specific-formats-processing
99
1010 .. image:: https://travis-ci.org/pyexcel/pyexcel-ods.svg?branch=master
1111 :target: http://travis-ci.org/pyexcel/pyexcel-ods
1313 .. image:: https://codecov.io/gh/pyexcel/pyexcel-ods/branch/master/graph/badge.svg
1414 :target: https://codecov.io/gh/pyexcel/pyexcel-ods
1515
16 .. image:: https://badge.fury.io/py/pyexcel-ods.svg
17 :target: https://pypi.org/project/pyexcel-ods
18
19
20 .. image:: https://pepy.tech/badge/pyexcel-ods/month
21 :target: https://pepy.tech/project/pyexcel-ods/month
22
23
1624 .. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
1725 :target: https://gitter.im/pyexcel/Lobby
1826
27 .. image:: https://img.shields.io/static/v1?label=continuous%20templating&message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0&color=blue&style=flat-square
28 :target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects
29
30 .. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
31 :target: https://github.com/psf/black
1932
2033 **pyexcel-ods** is a tiny wrapper library to read, manipulate and write data in
2134 ods format using python 2.6 and python 2.7. You are likely to use it with
2437 depends on ezodf and lxml. `pyexcel-odsr <https://github.com/pyexcel/pyexcel-odsr>`_
2538 is the other sister library that has no external dependency but do ods reading only
2639
40 Support the project
41 ================================================================================
42
43 If your company has embedded pyexcel and its components into a revenue generating
44 product, please support me on github, `patreon <https://www.patreon.com/bePatron?u=5537627>`_
45 or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
46 the project and develop it further.
47
48 If you are an individual, you are welcome to support me too and for however long
49 you feel like. As my backer, you will receive
50 `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
51
52 And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
53
54 With your financial support, I will be able to invest
55 a little bit more time in coding, documentation and writing interesting posts.
56
57
2758 Known constraints
2859 ==================
2960
4778 $ git clone https://github.com/pyexcel/pyexcel-ods.git
4879 $ cd pyexcel-ods
4980 $ python setup.py install
50
51 Support the project
52 ================================================================================
53
54 If your company has embedded pyexcel and its components into a revenue generating
55 product, please support me on `patreon <https://www.patreon.com/bePatron?u=5537627>`_
56 or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
57 the project and develop it further.
58
59 If you are an individual, you are welcome to support me too and for however long
60 you feel like. As my backer, you will receive
61 `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
62
63 And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
64
65 With your financial support, I will be able to invest
66 a little bit more time in coding, documentation and writing interesting posts.
67
6881
6982 Usage
7083 ================================================================================
347360
348361 > test.bat
349362
350 How to update test environment and update documentation
351 ---------------------------------------------------------
352
353 Additional steps are required:
354
355 #. pip install moban
356 #. git clone https://github.com/moremoban/setupmobans.git # generic setup
357 #. git clone https://github.com/pyexcel/pyexcel-commons.git commons
358 #. make your changes in `.moban.d` directory, then issue command `moban`
359
360 What is pyexcel-commons
361 ---------------------------------
362
363 Many information that are shared across pyexcel projects, such as: this developer guide, license info, etc. are stored in `pyexcel-commons` project.
364
365 What is .moban.d
366 ---------------------------------
367
368 `.moban.d` stores the specific meta data for the library.
369
370 Acceptance criteria
371 -------------------
372
373 #. Has Test cases written
374 #. Has all code lines tested
375 #. Passes all Travis CI builds
376 #. Has fair amount of documentation if your change is complex
377 #. run 'make format' so as to confirm the pyexcel organisation's coding style
378 #. Please update CHANGELOG.rst
379 #. Please add yourself to CONTRIBUTORS.rst
380 #. Agree on NEW BSD License for your contribution
363
364 Before you commit
365 ------------------------------
366
367 Please run::
368
369 $ make format
370
371 so as to beautify your code otherwise travis-ci may fail your unit test.
372
381373
382374 Credits
383375 ================================================================================
66 #
77 # This file only contains a selection of the most common options. For a full
88 # list see the documentation:
9 # http://www.sphinx-doc.org/en/master/config
9 # https://www.sphinx-doc.org/en/master/usage/configuration.html
1010
1111 # -- Path setup --------------------------------------------------------------
1212
2020
2121 # -- Project information -----------------------------------------------------
2222
23 project = 'pyexcel'
24 copyright = 'copyright 2015-2019 Onni Software Ltd.'
25 author = 'Onni Software Ltd.'
23 project = 'pyexcel-ods'
24 copyright = '2015-2020 Onni Software Ltd.'
25 author = 'chfw'
2626 # The short X.Y version
27 version = '0.5.6'
27 version = '0.6.0'
2828 # The full version, including alpha/beta/rc tags
29 release = '0.5.6'
29 release = '0.6.0'
3030
3131 # -- General configuration ---------------------------------------------------
3232
6767 # -- Options for intersphinx extension ---------------------------------------
6868
6969 # Example configuration for intersphinx: refer to the Python standard library.
70 intersphinx_mapping = {'https://docs.python.org/': None}
70 intersphinx_mapping = {'https://docs.python.org/3/': None}
7171 # TODO: html_theme not configurable upstream
7272 html_theme = 'default'
7373
8282 intersphinx_mapping.update({
8383 'pyexcel': ('http://pyexcel.readthedocs.io/en/latest/', None),
8484 })
85 master_doc = "index"
11 pyexcel_ods
22 ~~~~~~~~~~~~~~~~~~~
33 The lower level ods file format handler using odfpy
4 :copyright: (c) 2015-2017 by Onni Software Ltd & its contributors
4 :copyright: (c) 2015-2020 by Onni Software Ltd & its contributors
55 :license: New BSD License
66 """
77
1212
1313 # this line has to be place above all else
1414 # because of dynamic import
15 from pyexcel_io.plugins import IOPluginInfoChain
15 from pyexcel_io.plugins import IOPluginInfoChain, IOPluginInfoChainV2
1616
1717 __FILE_TYPE__ = "ods"
18 IOPluginInfoChain(__name__).add_a_reader(
18 IOPluginInfoChain(__name__)
19 IOPluginInfoChainV2(__name__).add_a_reader(
1920 relative_plugin_class_path="odsr.ODSBook",
21 locations=["file", "memory"],
22 file_types=[__FILE_TYPE__],
23 stream_type="binary",
24 ).add_a_reader(
25 relative_plugin_class_path="odsr.ODSBookInContent",
26 locations=["content"],
2027 file_types=[__FILE_TYPE__],
2128 stream_type="binary",
2229 ).add_a_writer(
2330 relative_plugin_class_path="odsw.ODSWriter",
31 locations=["file", "memory"],
2432 file_types=[__FILE_TYPE__],
2533 stream_type="binary",
2634 )
33
44 ods reader
55
6 :copyright: (c) 2014-2017 by Onni Software Ltd.
6 :copyright: (c) 2014-2020 by Onni Software Ltd.
77 :license: New BSD License, see LICENSE for more details
88 """
99 # Copyright 2011 Marco Conti
1919 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2020 # See the License for the specific language governing permissions and
2121 # limitations under the License.
22 from io import BytesIO
2223
2324 import pyexcel_io.service as service
24 from pyexcel_io._compact import OrderedDict
25 from pyexcel_io.book import BookReader
26 from pyexcel_io.sheet import SheetReader
27
28 from odf.namespaces import OFFICENS
29 from odf.opendocument import load
30 from odf.table import Table, TableCell, TableRow
25 from odf.text import P
26 from odf.table import Table, TableRow, TableCell
3127
3228 # Thanks to grt for the fixes
3329 from odf.teletype import extractText
34 from odf.text import P
30 from odf.namespaces import OFFICENS
31 from odf.opendocument import load
32 from pyexcel_io.plugin_api import ISheet, IReader, NamedContent
3533
3634
37 class ODSSheet(SheetReader):
35 class ODSSheet(ISheet):
3836 """native ods sheet"""
3937
4038 def __init__(self, sheet, auto_detect_int=True, **keywords):
41 SheetReader.__init__(self, sheet, **keywords)
39 self._native_sheet = sheet
40 self._keywords = keywords
4241 self.__auto_detect_int = auto_detect_int
4342
4443 @property
9998 return "\n".join(text_content)
10099
101100
102 class ODSBook(BookReader):
101 class ODSBook(IReader):
103102 """read ods book"""
104103
105 def open(self, file_name, **keywords):
106 """open ods file"""
107 BookReader.open(self, file_name, **keywords)
108 self._load_from_file()
104 def __init__(self, file_alike_object, _, **keywords):
105 self._native_book = load(file_alike_object)
106 self._keywords = keywords
107 self.content_array = [
108 NamedContent(table.getAttribute("name"), table)
109 for table in self._native_book.spreadsheet.getElementsByType(Table)
110 ]
109111
110 def open_stream(self, file_stream, **keywords):
111 """open ods file stream"""
112 BookReader.open_stream(self, file_stream, **keywords)
113 self._load_from_memory()
114
115 def read_sheet_by_name(self, sheet_name):
116 """read a named sheet"""
117 tables = self._native_book.spreadsheet.getElementsByType(Table)
118 rets = [
119 table
120 for table in tables
121 if table.getAttribute("name") == sheet_name
122 ]
123 if len(rets) == 0:
124 raise ValueError("%s cannot be found" % sheet_name)
125 else:
126 return self.read_sheet(rets[0])
127
128 def read_sheet_by_index(self, sheet_index):
112 def read_sheet(self, sheet_index):
129113 """read a sheet at a specified index"""
130 tables = self._native_book.spreadsheet.getElementsByType(Table)
131 length = len(tables)
132 if sheet_index < length:
133 return self.read_sheet(tables[sheet_index])
134 else:
135 raise IndexError(
136 "Index %d of out bound %d" % (sheet_index, length)
137 )
138
139 def read_all(self):
140 """read all sheets"""
141 result = OrderedDict()
142 for sheet in self._native_book.spreadsheet.getElementsByType(Table):
143 ods_sheet = ODSSheet(sheet, **self._keywords)
144 result[ods_sheet.name] = ods_sheet.to_array()
145
146 return result
147
148 def read_sheet(self, native_sheet):
149 """read one native sheet"""
150 sheet = ODSSheet(native_sheet, **self._keywords)
151 return {sheet.name: sheet.to_array()}
114 table = self.content_array[sheet_index].payload
115 sheet = ODSSheet(table, **self._keywords)
116 return sheet
152117
153118 def close(self):
154119 self._native_book = None
155120
156 def _load_from_memory(self):
157 self._native_book = load(self._file_stream)
158121
159 def _load_from_file(self):
160 self._native_book = load(self._file_name)
122 class ODSBookInContent(ODSBook):
123 """
124 Open xlsx as read only mode
125 """
126
127 def __init__(self, file_content, file_type, **keywords):
128 io = BytesIO(file_content)
129 super().__init__(io, file_type, **keywords)
33
44 ods writer
55
6 :copyright: (c) 2014-2017 by Onni Software Ltd.
6 :copyright: (c) 2014-2020 by Onni Software Ltd.
77 :license: New BSD License, see LICENSE for more details
88 """
9 import sys
10
119 import pyexcel_io.service as converter
12 from pyexcel_io.book import BookWriter
13 from pyexcel_io.sheet import SheetWriter
14
10 from odf.text import P
11 from odf.table import Table, TableRow, TableCell
1512 from odf.namespaces import OFFICENS
1613 from odf.opendocument import OpenDocumentSpreadsheet
17 from odf.table import Table, TableCell, TableRow
18 from odf.text import P
19
20 PY2 = sys.version_info[0] == 2
21
22 PY27_BELOW = PY2 and sys.version_info[1] < 7
14 from pyexcel_io.plugin_api import IWriter, ISheetWriter
2315
2416
25 class ODSSheetWriter(SheetWriter):
17 class ODSSheetWriter(ISheetWriter):
2618 """
2719 ODS sheet writer
2820 """
2921
30 def set_sheet_name(self, name):
31 """initialize the native table"""
32 self._native_sheet = Table(name=name)
33
34 def set_size(self, size):
35 """not used in this class but used in ods3"""
36 pass
22 def __init__(self, ods_book, sheet_name):
23 self._native_book = ods_book
24 self._native_sheet = Table(name=sheet_name)
3725
3826 def write_cell(self, row, cell):
3927 """write a native cell"""
7765 self._native_book.spreadsheet.addElement(self._native_sheet)
7866
7967
80 class ODSWriter(BookWriter):
68 class ODSWriter(IWriter):
8169 """
8270 open document spreadsheet writer
8371
8472 """
8573
86 def __init__(self):
87 BookWriter.__init__(self)
74 def __init__(self, file_alike_object, file_type, **_):
75 self.file_alike_object = file_alike_object
8876 self._native_book = OpenDocumentSpreadsheet()
8977
9078 def create_sheet(self, name):
9179 """
9280 write a row into the file
9381 """
94 return ODSSheetWriter(self._native_book, None, name)
82 return ODSSheetWriter(self._native_book, name)
9583
9684 def close(self):
9785 """
9886 This call writes file
9987
10088 """
101 self._native_book.write(self._file_alike_object)
89 self._native_book.write(self.file_alike_object)
10290 self._native_book = None
0 Metadata-Version: 1.1
0 Metadata-Version: 1.2
11 Name: pyexcel-ods
2 Version: 0.5.6
2 Version: 0.6.0
33 Summary: A wrapper library to read, manipulate and write data in ods format
44 Home-page: https://github.com/pyexcel/pyexcel-ods
5 Author: C.W.
6 Author-email: [email protected]
5 Author: chfw
6 Author-email: [email protected]
77 License: New BSD
8 Download-URL: https://github.com/pyexcel/pyexcel-ods/archive/0.5.6.tar.gz
8 Download-URL: https://github.com/pyexcel/pyexcel-ods/archive/0.6.0.tar.gz
99 Description: ================================================================================
1010 pyexcel-ods - Let you focus on data, instead of ods format
1111 ================================================================================
1212
1313 .. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png
14 :target: https://www.patreon.com/pyexcel
15
16 .. image:: https://api.bountysource.com/badge/team?team_id=288537
17 :target: https://salt.bountysource.com/teams/chfw-pyexcel
14 :target: https://www.patreon.com/chfw
15
16 .. image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
17 :target: https://awesome-python.com/#specific-formats-processing
1818
1919 .. image:: https://travis-ci.org/pyexcel/pyexcel-ods.svg?branch=master
2020 :target: http://travis-ci.org/pyexcel/pyexcel-ods
2222 .. image:: https://codecov.io/gh/pyexcel/pyexcel-ods/branch/master/graph/badge.svg
2323 :target: https://codecov.io/gh/pyexcel/pyexcel-ods
2424
25 .. image:: https://badge.fury.io/py/pyexcel-ods.svg
26 :target: https://pypi.org/project/pyexcel-ods
27
28
29 .. image:: https://pepy.tech/badge/pyexcel-ods/month
30 :target: https://pepy.tech/project/pyexcel-ods/month
31
32
2533 .. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
2634 :target: https://gitter.im/pyexcel/Lobby
2735
36 .. image:: https://img.shields.io/static/v1?label=continuous%20templating&message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0&color=blue&style=flat-square
37 :target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects
38
39 .. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
40 :target: https://github.com/psf/black
2841
2942 **pyexcel-ods** is a tiny wrapper library to read, manipulate and write data in
3043 ods format using python 2.6 and python 2.7. You are likely to use it with
3346 depends on ezodf and lxml. `pyexcel-odsr <https://github.com/pyexcel/pyexcel-odsr>`_
3447 is the other sister library that has no external dependency but do ods reading only
3548
49 Support the project
50 ================================================================================
51
52 If your company has embedded pyexcel and its components into a revenue generating
53 product, please support me on github, `patreon <https://www.patreon.com/bePatron?u=5537627>`_
54 or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
55 the project and develop it further.
56
57 If you are an individual, you are welcome to support me too and for however long
58 you feel like. As my backer, you will receive
59 `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
60
61 And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
62
63 With your financial support, I will be able to invest
64 a little bit more time in coding, documentation and writing interesting posts.
65
66
3667 Known constraints
3768 ==================
3869
5687 $ git clone https://github.com/pyexcel/pyexcel-ods.git
5788 $ cd pyexcel-ods
5889 $ python setup.py install
59
60 Support the project
61 ================================================================================
62
63 If your company has embedded pyexcel and its components into a revenue generating
64 product, please support me on `patreon <https://www.patreon.com/bePatron?u=5537627>`_
65 or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
66 the project and develop it further.
67
68 If you are an individual, you are welcome to support me too and for however long
69 you feel like. As my backer, you will receive
70 `early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
71
72 And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
73
74 With your financial support, I will be able to invest
75 a little bit more time in coding, documentation and writing interesting posts.
76
7790
7891 Usage
7992 ================================================================================
334347
335348 > test.bat
336349
337 How to update test environment and update documentation
338 ---------------------------------------------------------
339
340 Additional steps are required:
341
342 #. pip install moban
343 #. git clone https://github.com/moremoban/setupmobans.git # generic setup
344 #. git clone https://github.com/pyexcel/pyexcel-commons.git commons
345 #. make your changes in `.moban.d` directory, then issue command `moban`
346
347 What is pyexcel-commons
348 ---------------------------------
349
350 Many information that are shared across pyexcel projects, such as: this developer guide, license info, etc. are stored in `pyexcel-commons` project.
351
352 What is .moban.d
353 ---------------------------------
354
355 `.moban.d` stores the specific meta data for the library.
356
357 Acceptance criteria
358 -------------------
359
360 #. Has Test cases written
361 #. Has all code lines tested
362 #. Passes all Travis CI builds
363 #. Has fair amount of documentation if your change is complex
364 #. run 'make format' so as to confirm the pyexcel organisation's coding style
365 #. Please update CHANGELOG.rst
366 #. Please add yourself to CONTRIBUTORS.rst
367 #. Agree on NEW BSD License for your contribution
350
351 Before you commit
352 ------------------------------
353
354 Please run::
355
356 $ make format
357
358 so as to beautify your code otherwise travis-ci may fail your unit test.
359
368360
369361 Credits
370362 ================================================================================
375367 Change log
376368 ================================================================================
377369
370 0.6.0 - 9.10.2020
371 --------------------------------------------------------------------------------
372
373 **added**
374
375 #. new style reader and writer plugins. works with pyexcel-io v0.6.2
376
378377 0.5.6 - 19.03.2019
379378 --------------------------------------------------------------------------------
380379
381 added
382 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
380 **added**
383381
384382 #. `#32 <https://github.com/pyexcel/pyexcel-ods/issues/32>`_, fix odfpy pinning
385383 #. `#33 <https://github.com/pyexcel/pyexcel-ods/issues/33>`_, fix
388386 0.5.5 - 16.03.2019
389387 --------------------------------------------------------------------------------
390388
391 added
392 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
389 **added**
393390
394391 #. `#32 <https://github.com/pyexcel/pyexcel-ods/issues/32>`_, fix odfpy pinning
395392
396393 0.5.4 - 27.11.2018
397394 --------------------------------------------------------------------------------
398395
399 added
400 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
396 **added**
401397
402398 #. `#30 <https://github.com/pyexcel/pyexcel-ods/issues/30>`_, long type will not
403399 be written in ods. please use string type. And if the integer is equal or
407403 0.5.3 - unreleased
408404 --------------------------------------------------------------------------------
409405
410 added
411 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
406 **added**
412407
413408 #. `#24 <https://github.com/pyexcel/pyexcel-ods/issues/24>`_, ignore
414409 comments(<office:comment>) in cell
419414 0.5.2 - 23.10.2017
420415 --------------------------------------------------------------------------------
421416
422 updated
423 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
417 **updated**
424418
425419 #. pyexcel `pyexcel#105 <https://github.com/pyexcel/pyexcel/issues/105>`_,
426420 remove gease from setup_requires, introduced by 0.5.1.
429423 0.5.1 - 20.10.2017
430424 --------------------------------------------------------------------------------
431425
432 added
433 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
426 **added**
434427
435428 #. `pyexcel#103 <https://github.com/pyexcel/pyexcel/issues/103>`_, include
436429 LICENSE file in MANIFEST.in, meaning LICENSE file will appear in the released
439432 0.5.0 - 30.08.2017
440433 --------------------------------------------------------------------------------
441434
442 Updated
443 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
435 **Updated**
444436
445437 #. put dependency on pyexcel-io 0.5.0, which uses cStringIO instead of StringIO.
446438 Hence, there will be performance boost in handling files in memory.
447439
448 Relocated
449 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
440 **Relocated**
450441
451442 #. All ods type conversion code lives in pyexcel_io.service module
452443
453444 0.4.1 - 25.08.2017
454445 --------------------------------------------------------------------------------
455446
456 Updated
457 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
447 **Updated**
458448
459449 #. `pyexcel#23 <https://github.com/pyexcel/pyexcel/issues/23>`_, handle
460450 unseekable stream given by http response
464454 0.4.0 - 19.06.2017
465455 --------------------------------------------------------------------------------
466456
467 Updated
468 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
457 **Updated**
469458
470459 #. `pyexcel#14 <https://github.com/pyexcel/pyexcel/issues/14>`_, close file
471460 handle
475464 0.3.3 - 07.05.2017
476465 --------------------------------------------------------------------------------
477466
478 Updated
479 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
467 **Updated**
480468
481469 #. issue `pyexcel#19 <https://github.com/pyexcel/pyexcel/issues/19>`_, not all
482470 texts in a multi-node cell were extracted.
484472 0.3.2 - 13.04.2017
485473 --------------------------------------------------------------------------------
486474
487 Updated
488 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
475 **Updated**
489476
490477 #. issue `pyexcel#17 <https://github.com/pyexcel/pyexcel/issues/17>`_, empty new
491478 line is ignored
495482 0.3.1 - 02.02.2017
496483 --------------------------------------------------------------------------------
497484
498 Added
499 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
485 **Added**
500486
501487 #. Recognize currency type
502488
503489 0.3.0 - 22.12.2016
504490 --------------------------------------------------------------------------------
505491
506 Updated
507 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
492 **Updated**
508493
509494 #. Code refactoring with pyexcel-io v 0.3.0
510495
511496 0.2.2 - 24.10.2016
512497 --------------------------------------------------------------------------------
513498
514 Updated
515 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
499 **Updated**
516500
517501 #. issue `pyexcel#14 <https://github.com/pyexcel/pyexcel/issues/14>`_, index
518502 error when reading a ods file that has non-uniform columns repeated property.
520504 0.2.1 - 31.08.2016
521505 --------------------------------------------------------------------------------
522506
523 Added
524 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
507 **Added**
525508
526509 #. support pagination. two pairs: start_row, row_limit and start_column,
527510 column_limit help you deal with large files.
530513 0.2.0 - 01.06.2016
531514 --------------------------------------------------------------------------------
532515
533 Added
534 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
516 **Added**
535517
536518 #. By default, `float` will be converted to `int` where fits. `auto_detect_int`,
537519 a flag to switch off the autoatic conversion from `float` to `int`.
538520 #. 'library=pyexcel-ods' was added so as to inform pyexcel to use it instead of
539521 other libraries, in the situation where multiple plugins were installed.
540522
541 Updated
542 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
523 **Updated**
543524
544525 #. support the auto-import feature of pyexcel-io 0.2.0
545526
546527 0.1.1 - 30.01.2016
547528 --------------------------------------------------------------------------------
548529
549 Added
550 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 **Added**
551531
552532 #. 'streaming' is an extra option given to get_data. Only when 'streaming' is
553533 explicitly set to True, the data will be consisted of generators, hence will
556536 #. support multi-line text cell #5
557537 #. feature migration from pyexcel-ods3 pyexcel/pyexcel-ods3#5
558538
559 Updated
560 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
539 **Updated**
561540
562541 #. compatibility with pyexcel-io 0.1.1
563542
564543 0.0.12 - 10.10.2015
565544 --------------------------------------------------------------------------------
566545
567 Updated
568 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
546 **Updated**
569547
570548 #. Bug fix: excessive trailing columns with empty values
571549
572550 0.0.11 - 26.09.2015
573551 --------------------------------------------------------------------------------
574552
575 Updated
576 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
553 **Updated**
577554
578555 #. Complete fix for libreoffice datetime field
579556
580557 0.0.10 - 15.09.2015
581558 --------------------------------------------------------------------------------
582559
583 Updated
584 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
560 **Updated**
585561
586562 #. Bug fix: date field could have datetime from libreoffice
587563
588564 0.0.9 - 21.08.2015
589565 --------------------------------------------------------------------------------
590566
591 Updated
592 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
567 **Updated**
593568
594569 #. Bug fix: utf-8 string throw unicode exceptions
595570
596571 0.0.8 - 28.06.2015
597572 --------------------------------------------------------------------------------
598573
599 Updated
600 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
574 **Updated**
601575
602576 #. Pin dependency odfpy 0.9.6 to avoid buggy odfpy 1.3.0
603577
604578 0.0.7 - 28.05.2015
605579 --------------------------------------------------------------------------------
606580
607 Updated
608 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
581 **Updated**
609582
610583 #. Bug fix: "number-columns-repeated" is now respected
611584
612585 0.0.6 - 21.05.2015
613586 --------------------------------------------------------------------------------
614587
615 Updated
616 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
588 **Updated**
617589
618590 #. get_data and save_data are seen across pyexcel-* extensions. remember them
619591 once and use them across all extensions.
621593 0.0.5 - 22.02.2015
622594 --------------------------------------------------------------------------------
623595
624 Added
625 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
596 **Added**
626597
627598 #. Loads only one sheet from a multiple sheet book
628599 #. Use New BSD License
630601 0.0.4 - 14.12.2014
631602 --------------------------------------------------------------------------------
632603
633 Updated
634 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
604 **Updated**
635605
636606 #. IO interface update as pyexcel-io introduced keywords.
637607 #. initial release
639609 0.0.3 - 08.12.2014
640610 --------------------------------------------------------------------------------
641611
642 Updated
643 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
612 **Updated**
644613
645614 #. IO interface update as pyexcel-io introduced keywords.
646615 #. initial release
651620 Classifier: Topic :: Software Development :: Libraries
652621 Classifier: Programming Language :: Python
653622 Classifier: Intended Audience :: Developers
654 Classifier: Programming Language :: Python :: 2.6
655 Classifier: Programming Language :: Python :: 2.7
656 Classifier: Programming Language :: Python :: 3.3
657 Classifier: Programming Language :: Python :: 3.4
658 Classifier: Programming Language :: Python :: 3.5
623 Classifier: Programming Language :: Python :: 3 :: Only
659624 Classifier: Programming Language :: Python :: 3.6
625 Classifier: Programming Language :: Python :: 3.7
626 Classifier: Programming Language :: Python :: 3.8
627 Requires-Python: >=3.6
00 CHANGELOG.rst
1 CONTRIBUTORS.rst
12 LICENSE
23 MANIFEST.in
34 README.rst
0 pyexcel-io>=0.5.16
0 pyexcel-io>=0.6.2
11 odfpy>=1.3.5
00 #!/usr/bin/env python3
11
2 """
3 Template by pypi-mobans
4 """
5
6 import os
7 import sys
28 import codecs
39 import locale
4 # Template by pypi-mobans
5 import os
610 import platform
7 import sys
811 from shutil import rmtree
912
10 from setuptools import Command, find_packages, setup
13 from setuptools import Command, setup, find_packages
14
1115
1216 # Work around mbcs bug in distutils.
1317 # http://bugs.python.org/issue10945
1721 try:
1822 lc = locale.getlocale()
1923 pf = platform.system()
20 if pf != 'Windows' and lc == (None, None):
21 locale.setlocale(locale.LC_ALL, 'C.UTF-8')
24 if pf != "Windows" and lc == (None, None):
25 locale.setlocale(locale.LC_ALL, "C.UTF-8")
2226 except (ValueError, UnicodeError, locale.Error):
23 locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
24
25 NAME = 'pyexcel-ods'
26 AUTHOR = 'C.W.'
27 VERSION = '0.5.6'
28 EMAIL = '[email protected]'
29 LICENSE = 'New BSD'
27 locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
28
29 NAME = "pyexcel-ods"
30 AUTHOR = "chfw"
31 VERSION = "0.6.0"
32 EMAIL = "[email protected]"
33 LICENSE = "New BSD"
3034 DESCRIPTION = (
31 'A wrapper library to read, manipulate and write data in ods format'
35 "A wrapper library to read, manipulate and write data in ods format"
3236 )
33 URL = 'https://github.com/pyexcel/pyexcel-ods'
34 DOWNLOAD_URL = '%s/archive/0.5.6.tar.gz' % URL
35 FILES = ['README.rst', 'CHANGELOG.rst']
37 URL = "https://github.com/pyexcel/pyexcel-ods"
38 DOWNLOAD_URL = "%s/archive/0.6.0.tar.gz" % URL
39 FILES = ["README.rst", "CHANGELOG.rst"]
3640 KEYWORDS = [
37 'python',
41 "python",
3842 ]
3943
4044 CLASSIFIERS = [
41 'Topic :: Software Development :: Libraries',
42 'Programming Language :: Python',
43 'Intended Audience :: Developers',
44 'Programming Language :: Python :: 2.6',
45 'Programming Language :: Python :: 2.7',
46 'Programming Language :: Python :: 3.3',
47 'Programming Language :: Python :: 3.4',
48 'Programming Language :: Python :: 3.5',
49 'Programming Language :: Python :: 3.6',
45 "Topic :: Software Development :: Libraries",
46 "Programming Language :: Python",
47 "Intended Audience :: Developers",
48
49 "Programming Language :: Python :: 3 :: Only",
50
51
52
53 "Programming Language :: Python :: 3.6",
54 "Programming Language :: Python :: 3.7",
55 "Programming Language :: Python :: 3.8",
56
5057 ]
5158
59 PYTHON_REQUIRES = ">=3.6"
60
5261 INSTALL_REQUIRES = [
53 'pyexcel-io>=0.5.16',
54 'odfpy>=1.3.5',
62 "pyexcel-io>=0.6.2",
63 "odfpy>=1.3.5",
5564 ]
5665 SETUP_COMMANDS = {}
5766
58
59 PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
67 PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests", "tests.*"])
6068 EXTRAS_REQUIRE = {
6169 }
6270 # You do not need to read beyond this line
63 PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format(
64 sys.executable)
65 GS_COMMAND = ('gs pyexcel-ods v0.5.6 ' +
66 "Find 0.5.6 in changelog for more details")
67 NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
68 'Please install gease to enable it.')
71 PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
72 GS_COMMAND = ("gs pyexcel-ods v0.6.0 " +
73 "Find 0.6.0 in changelog for more details")
74 NO_GS_MESSAGE = ("Automatic github release is disabled. " +
75 "Please install gease to enable it.")
6976 UPLOAD_FAILED_MSG = (
7077 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
7178 HERE = os.path.abspath(os.path.dirname(__file__))
7481 class PublishCommand(Command):
7582 """Support setup.py upload."""
7683
77 description = 'Build and publish the package on github and pypi'
84 description = "Build and publish the package on github and pypi"
7885 user_options = []
7986
8087 @staticmethod
8188 def status(s):
8289 """Prints things in bold."""
83 print('\033[1m{0}\033[0m'.format(s))
90 print("\033[1m{0}\033[0m".format(s))
8491
8592 def initialize_options(self):
8693 pass
9097
9198 def run(self):
9299 try:
93 self.status('Removing previous builds...')
94 rmtree(os.path.join(HERE, 'dist'))
95 rmtree(os.path.join(HERE, 'build'))
96 rmtree(os.path.join(HERE, 'pyexcel_ods.egg-info'))
100 self.status("Removing previous builds...")
101 rmtree(os.path.join(HERE, "dist"))
102 rmtree(os.path.join(HERE, "build"))
103 rmtree(os.path.join(HERE, "pyexcel_ods.egg-info"))
97104 except OSError:
98105 pass
99106
100 self.status('Building Source and Wheel (universal) distribution...')
107 self.status("Building Source and Wheel (universal) distribution...")
101108 run_status = True
102109 if has_gease():
103110 run_status = os.system(GS_COMMAND) == 0
105112 self.status(NO_GS_MESSAGE)
106113 if run_status:
107114 if os.system(PUBLISH_COMMAND) != 0:
108 self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND)
115 self.status(UPLOAD_FAILED_MSG)
109116
110117 sys.exit()
111118
112119
113120 SETUP_COMMANDS.update({
114 'publish': PublishCommand
121 "publish": PublishCommand
115122 })
116123
117124
140147 def read(afile):
141148 """Read a file into setup"""
142149 the_relative_file = os.path.join(HERE, afile)
143 with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file:
150 with codecs.open(the_relative_file, "r", "utf-8") as opened_file:
144151 content = filter_out_test_code(opened_file)
145152 content = "".join(list(content))
146153 return content
149156 def filter_out_test_code(file_handle):
150157 found_test_code = False
151158 for line in file_handle.readlines():
152 if line.startswith('.. testcode:'):
159 if line.startswith(".. testcode:"):
153160 found_test_code = True
154161 continue
155162 if found_test_code is True:
156 if line.startswith(' '):
163 if line.startswith(" "):
157164 continue
158165 else:
159166 empty_line = line.strip()
163170 found_test_code = False
164171 yield line
165172 else:
166 for keyword in ['|version|', '|today|']:
173 for keyword in ["|version|", "|today|"]:
167174 if keyword in line:
168175 break
169176 else:
170177 yield line
171178
172179
173 if __name__ == '__main__':
180 if __name__ == "__main__":
174181 setup(
175182 test_suite="tests",
176183 name=NAME,
183190 long_description=read_files(*FILES),
184191 license=LICENSE,
185192 keywords=KEYWORDS,
193 python_requires=PYTHON_REQUIRES,
186194 extras_require=EXTRAS_REQUIRE,
187 tests_require=['nose'],
195 tests_require=["nose"],
188196 install_requires=INSTALL_REQUIRES,
189197 packages=PACKAGES,
190198 include_package_data=True,
0 import os # noqa
01 import datetime # noqa
1 import os # noqa
22
33 import pyexcel
4
45 from nose.tools import eq_, raises # noqa
56
67
22 codecov
33 coverage
44 flake8
5 black
6 isort
7 collective.checkdocs
8 pygments
59 moban
6 black;python_version>="3.6"
7 isort;python_version>="3.6"
10 moban_jinja2_github
11 pyexcel
812 psutil
9 pyexcel
1013 pyexcel-xls
33
44 import psutil
55 import pyexcel as pe
6 from pyexcel_ods import get_data, save_data
7 from pyexcel_io.exceptions import IntegerAccuracyLossError
8
69 from nose import SkipTest
710 from nose.tools import eq_, raises
8 from pyexcel_io.exceptions import IntegerAccuracyLossError
9
10 from pyexcel_ods import get_data, save_data
1111
1212 IN_TRAVIS = "TRAVIS" in os.environ
1313
00 import os
11
2 from pyexcel_io import get_data, save_data
3
24 from nose.tools import eq_
3 from pyexcel_io import get_data, save_data
45
56
67 class TestFilter:
11 from textwrap import dedent
22
33 import pyexcel as pe
4
45 from nose.tools import eq_
56
67
11 import sys
22
33 import pyexcel
4 from base import PyexcelMultipleSheetBase
5
46 from nose.tools import raises
5
6 from base import PyexcelMultipleSheetBase
77
88 if sys.version_info[0] == 2 and sys.version_info[1] < 7:
99 from ordereddict import OrderedDict
22 from base import ODSCellTypes
33 from pyexcel_ods.odsr import ODSBook
44 from pyexcel_ods.odsw import ODSWriter
5 from pyexcel_io.reader import Reader
56
67
78 class TestODSReader(ODSCellTypes):
89 def setUp(self):
9 r = ODSBook()
10 r = Reader("ods")
11 r.reader_class = ODSBook
1012 r.open(os.path.join("tests", "fixtures", "ods_formats.ods"))
1113 self.data = r.read_all()
1214 for key in self.data.keys():
1618
1719 class TestODSWriter(ODSCellTypes):
1820 def setUp(self):
19 r = ODSBook()
21 r = Reader("ods")
22 r.reader_class = ODSBook
2023 r.open(os.path.join("tests", "fixtures", "ods_formats.ods"))
24 r.close()
2125 self.data1 = r.read_all()
2226 self.testfile = "odswriter.ods"
23 w = ODSWriter()
24 w.open(self.testfile)
27 w = ODSWriter(self.testfile, "ods")
2528 w.write(self.data1)
2629 w.close()
27 r2 = ODSBook()
28 r2.open(self.testfile)
29 self.data = r2.read_all()
30 r.open(self.testfile)
31 self.data = r.read_all()
3032 for key in self.data.keys():
3133 self.data[key] = list(self.data[key])
3234
00 import os
11
22 import pyexcel
3 from base import create_sample_file1
4
35 from nose.tools import eq_
4
5 from base import create_sample_file1
66
77
88 class TestStringIO:
00 import os
11
2 from base import PyexcelHatWriterBase, PyexcelWriterBase
3 from pyexcel_ods.odsr import ODSBook as Reader
2 from base import PyexcelWriterBase, PyexcelHatWriterBase
3 from pyexcel_io import get_data
44 from pyexcel_ods.odsw import ODSWriter as Writer
55
66
1212 "Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]],
1313 }
1414 self.testfile = "writer.ods"
15 writer = Writer()
16 writer.open(self.testfile)
15 writer = Writer(self.testfile, "ods")
1716 writer.write(self.content)
1817 writer.close()
19 reader = Reader()
20 reader.open(self.testfile)
21 content = reader.read_all()
22 for key in content.keys():
23 content[key] = list(content[key])
18 content = get_data(self.testfile, library="pyexcel-ods")
2419 assert content == self.content
25 reader.close()
2620
2721 def tearDown(self):
2822 if os.path.exists(self.testfile):