1
1
================================================================================
2
- pyexcel-odsr - Let you focus on data, instead of ods format
2
+ - Let you focus on data, instead of format
3
3
================================================================================
4
4
5
5
.. image :: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png
@@ -8,18 +8,18 @@ pyexcel-odsr - Let you focus on data, instead of ods format
8
8
.. image :: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
9
9
:target: https://awesome-python.com/#specific-formats-processing
10
10
11
- .. image :: https://travis-ci.org/pyexcel/pyexcel-odsr .svg?branch=master
12
- :target: http://travis-ci.org/pyexcel/pyexcel-odsr
11
+ .. image :: https://travis-ci.org// .svg?branch=
12
+ :target: http://travis-ci.org//
13
13
14
- .. image :: https://codecov.io/gh/pyexcel/pyexcel-odsr /branch/master/graph/badge.svg
15
- :target: https://codecov.io/gh/pyexcel/pyexcel-odsr
14
+ .. image :: https://codecov.io/gh// /branch/master/graph/badge.svg
15
+ :target: https://codecov.io/gh//
16
16
17
- .. image :: https://badge.fury.io/py/pyexcel-odsr .svg
18
- :target: https://pypi.org/project/pyexcel-odsr
17
+ .. image :: https://badge.fury.io/py/.svg
18
+ :target: https://pypi.org/project/
19
19
20
20
21
- .. image :: https://pepy.tech/badge/pyexcel-odsr /month
22
- :target: https://pepy.tech/project/pyexcel-odsr /month
21
+ .. image :: https://pepy.tech/badge//month
22
+ :target: https://pepy.tech/project//month
23
23
24
24
25
25
.. image :: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
@@ -61,19 +61,19 @@ Installation
61
61
================================================================================
62
62
63
63
64
- You can install pyexcel-odsr via pip:
64
+ You can install via pip:
65
65
66
66
.. code-block :: bash
67
67
68
- $ pip install pyexcel-odsr
68
+ $ pip install
69
69
70
70
71
71
or clone it and install it:
72
72
73
73
.. code-block :: bash
74
74
75
- $ git clone https://github.com/pyexcel/pyexcel-odsr .git
76
- $ cd pyexcel-odsr
75
+ $ git clone https://github.com// .git
76
+ $ cd
77
77
$ python setup.py install
78
78
79
79
Usage
@@ -105,18 +105,18 @@ As a standalone library
105
105
>>> data = OrderedDict() # from collections import OrderedDict
106
106
>>> data.update({" Sheet 1" : [[1 , 2 , 3 ], [4 , 5 , 6 ]]})
107
107
>>> data.update({" Sheet 2" : [[" row 1" , " row 2" , " row 3" ]]})
108
- >>> save_data(" your_file.ods " , data)
108
+ >>> save_data(" your_file." , data)
109
109
110
110
111
- Read from an ods file
111
+ Read from an file
112
112
********************************************************************************
113
113
114
114
Here's the sample code:
115
115
116
116
.. code-block :: python
117
117
118
- >> > from pyexcel_odsr import get_data
119
- >> > data = get_data(" your_file.ods " )
118
+ >> > from pyexcel_ import get_data
119
+ >> > data = get_data(" your_file." )
120
120
>> > import json
121
121
>> > print (json.dumps(data))
122
122
{" Sheet 1" : [[1 , 2 , 3 ], [4 , 5 , 6 ]], " Sheet 2" : [[" row 1" , " row 2" , " row 3" ]]}
@@ -139,16 +139,16 @@ Here's the sample code:
139
139
140
140
141
141
142
- Read from an ods from memory
142
+ Read from an from memory
143
143
********************************************************************************
144
144
145
145
Continue from previous example:
146
146
147
147
.. code-block :: python
148
148
149
149
>> > # This is just an illustration
150
- >> > # In reality, you might deal with ods file upload
151
- >> > # where you will read from requests.FILES['YOUR_ODS_FILE ']
150
+ >> > # In reality, you might deal with file upload
151
+ >> > # where you will read from requests.FILES['YOUR__FILE ']
152
152
>> > data = get_data(io)
153
153
>> > print (json.dumps(data))
154
154
{" Sheet 1" : [[1 , 2 , 3 ], [4 , 5 , 6 ]], " Sheet 2" : [[7 , 8 , 9 ], [10 , 11 , 12 ]]}
@@ -159,7 +159,7 @@ Pagination feature
159
159
160
160
161
161
162
- Let's assume the following file is a huge ods file:
162
+ Let's assume the following file is a huge file:
163
163
164
164
.. code-block :: python
165
165
@@ -174,29 +174,29 @@ Let's assume the following file is a huge ods file:
174
174
>> > sheetx = {
175
175
... " huge" : huge_data
176
176
... }
177
- >> > save_data(" huge_file.ods " , sheetx)
177
+ >> > save_data(" huge_file." , sheetx)
178
178
179
179
And let's pretend to read partial data:
180
180
181
181
.. code-block :: python
182
182
183
- >> > partial_data = get_data(" huge_file.ods " , start_row = 2 , row_limit = 3 )
183
+ >> > partial_data = get_data(" huge_file." , start_row = 2 , row_limit = 3 )
184
184
>> > print (json.dumps(partial_data))
185
185
{" huge" : [[3 , 23 , 33 ], [4 , 24 , 34 ], [5 , 25 , 35 ]]}
186
186
187
187
And you could as well do the same for columns:
188
188
189
189
.. code-block :: python
190
190
191
- >> > partial_data = get_data(" huge_file.ods " , start_column = 1 , column_limit = 2 )
191
+ >> > partial_data = get_data(" huge_file." , start_column = 1 , column_limit = 2 )
192
192
>> > print (json.dumps(partial_data))
193
193
{" huge" : [[21 , 31 ], [22 , 32 ], [23 , 33 ], [24 , 34 ], [25 , 35 ], [26 , 36 ]]}
194
194
195
195
Obvious, you could do both at the same time:
196
196
197
197
.. code-block :: python
198
198
199
- >> > partial_data = get_data(" huge_file.ods " ,
199
+ >> > partial_data = get_data(" huge_file." ,
200
200
... start_row = 2 , row_limit = 3 ,
201
201
... start_column = 1 , column_limit = 2 )
202
202
>> > print (json.dumps(partial_data))
@@ -205,26 +205,26 @@ Obvious, you could do both at the same time:
205
205
.. testcode ::
206
206
:hide:
207
207
208
- >>> os.unlink(" huge_file.ods " )
208
+ >>> os.unlink(" huge_file." )
209
209
210
210
211
211
As a pyexcel plugin
212
212
--------------------------------------------------------------------------------
213
213
214
214
No longer, explicit import is needed since pyexcel version 0.2.2. Instead,
215
- this library is auto-loaded. So if you want to read data in ods format,
215
+ this library is auto-loaded. So if you want to read data in format,
216
216
installing it is enough.
217
217
218
218
219
- Reading from an ods file
219
+ Reading from an file
220
220
********************************************************************************
221
221
222
222
Here is the sample code:
223
223
224
224
.. code-block :: python
225
225
226
226
>> > import pyexcel as pe
227
- >> > sheet = pe.get_book(file_name = " your_file.ods " )
227
+ >> > sheet = pe.get_book(file_name = " your_file." )
228
228
>> > sheet
229
229
Sheet 1 :
230
230
+ -- -+ -- -+ -- -+
@@ -242,24 +242,24 @@ Here is the sample code:
242
242
.. testcode ::
243
243
:hide:
244
244
245
- >>> sheet.save_as(" another_file.ods " )
245
+ >>> sheet.save_as(" another_file." )
246
246
247
247
248
248
249
249
Reading from a IO instance
250
250
********************************************************************************
251
251
252
- You got to wrap the binary content with stream to get ods working:
252
+ You got to wrap the binary content with stream to get working:
253
253
254
254
.. code-block :: python
255
255
256
256
>> > # This is just an illustration
257
- >> > # In reality, you might deal with ods file upload
258
- >> > # where you will read from requests.FILES['YOUR_ODS_FILE ']
259
- >> > odsfile = " another_file.ods "
260
- >> > with open (odsfile , " rb" ) as f:
257
+ >> > # In reality, you might deal with file upload
258
+ >> > # where you will read from requests.FILES['YOUR__FILE ']
259
+ >> > file = " another_file."
260
+ >> > with open (file , " rb" ) as f:
261
261
... content = f.read()
262
- ... r = pe.get_book(file_type = " ods " , file_content = content)
262
+ ... r = pe.get_book(file_type = " " , file_content = content)
263
263
... print (r)
264
264
...
265
265
Sheet 1 :
@@ -279,15 +279,15 @@ You got to wrap the binary content with stream to get ods working:
279
279
License
280
280
================================================================================
281
281
282
- New BSD License
282
+ License
283
283
284
284
Developer guide
285
285
==================
286
286
287
287
Development steps for code changes
288
288
289
- #. git clone https://github.com/pyexcel/pyexcel-odsr .git
290
- #. cd pyexcel-odsr
289
+ #. git clone https://github.com/pyexcel/.git
290
+ #. cd
291
291
292
292
Upgrade your setup tools and pip. They are needed for development and testing only:
293
293
@@ -344,5 +344,5 @@ This library is based on the ods of messytables, Open Knowledge Foundation Ltd.
344
344
:hide:
345
345
346
346
>>> import os
347
- >>> os.unlink(" your_file.ods " )
348
- >>> os.unlink(" another_file.ods " )
347
+ >>> os.unlink(" your_file." )
348
+ >>> os.unlink(" another_file." )
0 commit comments