@@ -18,12 +18,14 @@ Fonts, colors and charts are not supported.
18
18
Installation
19
19
============
20
20
21
- You can install it via pip::
21
+ You can install it via pip:
22
22
23
- $ pip install pyexcel-xls
23
+ .. code-block :: bash
24
24
25
25
26
- or clone it and install it::
26
+ or clone it and install it:
27
+
28
+ .. code-block :: bash
27
29
28
30
$ git clone http://github.com/chfw/pyexcel-xls.git
29
31
$ cd pyexcel-xls
@@ -49,7 +51,9 @@ Write to an xls file
49
51
>>> from pyexcel_io import OrderedDict
50
52
51
53
52
- Here's the sample code to write a dictionary to an xls file::
54
+ Here's the sample code to write a dictionary to an xls file:
55
+
56
+ .. code-block :: python
53
57
54
58
>> > from pyexcel_xls import save_data
55
59
>> > data = OrderedDict() # from collections import OrderedDict
@@ -60,7 +64,9 @@ Here's the sample code to write a dictionary to an xls file::
60
64
Read from an xls file
61
65
**********************
62
66
63
- Here's the sample code::
67
+ Here's the sample code:
68
+
69
+ .. code-block :: python
64
70
65
71
>> > from pyexcel_xls import get_data
66
72
>> > data = get_data(" your_file.xls" )
@@ -71,7 +77,9 @@ Here's the sample code::
71
77
Write an xls to memory
72
78
**********************
73
79
74
- Here's the sample code to write a dictionary to an xls file::
80
+ Here's the sample code to write a dictionary to an xls file:
81
+
82
+ .. code-block :: python
75
83
76
84
>> > from pyexcel_xls import save_data
77
85
>> > data = OrderedDict()
@@ -87,7 +95,9 @@ Here's the sample code to write a dictionary to an xls file::
87
95
Read from an xls from memory
88
96
*****************************
89
97
90
- Continue from previous example::
98
+ Continue from previous example:
99
+
100
+ .. code-block :: python
91
101
92
102
>> > # This is just an illustration
93
103
>> > # In reality, you might deal with xls file upload
@@ -100,7 +110,9 @@ Continue from previous example::
100
110
As a pyexcel plugin
101
111
--------------------
102
112
103
- Import it in your file to enable this plugin::
113
+ Import it in your file to enable this plugin:
114
+
115
+ .. code-block :: python
104
116
105
117
from pyexcel.ext import xls
106
118
@@ -109,7 +121,9 @@ Please note only pyexcel version 0.0.4+ support this.
109
121
Reading from an xls file
110
122
************************
111
123
112
- Here is the sample code::
124
+ Here is the sample code:
125
+
126
+ .. code-block :: python
113
127
114
128
>> > import pyexcel as pe
115
129
>> > from pyexcel.ext import xls
@@ -129,14 +143,18 @@ Here is the sample code::
129
143
Writing to an xls file
130
144
**********************
131
145
132
- Here is the sample code::
146
+ Here is the sample code:
147
+
148
+ .. code-block :: python
133
149
134
150
>> > sheet.save_as(" another_file.xls" )
135
151
136
152
Reading from a IO instance
137
153
================================
138
154
139
- You got to wrap the binary content with stream to get xls working::
155
+ You got to wrap the binary content with stream to get xls working:
156
+
157
+ .. code-block :: python
140
158
141
159
>> > # This is just an illustration
142
160
>> > # In reality, you might deal with xls file upload
@@ -162,7 +180,9 @@ You got to wrap the binary content with stream to get xls working::
162
180
Writing to a StringIO instance
163
181
================================
164
182
165
- You need to pass a StringIO instance to Writer::
183
+ You need to pass a StringIO instance to Writer:
184
+
185
+ .. code-block :: python
166
186
167
187
>> > data = [
168
188
... [1 , 2 , 3 ],
0 commit comments