Skip to content

Commit 1735f50

Browse files
committed
update documentation
1 parent dfe823e commit 1735f50

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

doc/source/index.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ The highlighted features are:
3030
================ =========================================
3131
Plugins Supported file formats
3232
================ =========================================
33-
`xls`_ xls, xlsx(r), xlsm(r)
34-
`xlsx`_ xlsx
35-
`ods3`_ ods (python 2.6, 2.7, 3.3, 3.4)
36-
`ods`_ ods (python 2.6, 2.7)
37-
`text`_ write only)json, rst, mediawiki,
33+
`pyexcel-xls`_ xls, xlsx(r), xlsm(r)
34+
`pyexcel-xlsx`_ xlsx
35+
`pyexcel-ods3`_ ods (python 2.6, 2.7, 3.3, 3.4)
36+
`pyexcel-ods`_ ods (python 2.6, 2.7)
37+
`pyexcel-text`_ (write only)json, rst, mediawiki,
3838
latex, grid, pipe, orgtbl, plain simple
3939
================ =========================================
4040

41-
.. _xls: https://github.com/chfw/pyexcel-xls
42-
.. _xlsx: https://github.com/chfw/pyexcel-xlsx
43-
.. _ods: https://github.com/chfw/pyexcel-ods
44-
.. _ods3: https://github.com/chfw/pyexcel-ods3
45-
.. _text: https://github.com/chfw/pyexcel-text
41+
.. _pyexcel-xls: https://github.com/chfw/pyexcel-xls
42+
.. _pyexcel-xlsx: https://github.com/chfw/pyexcel-xlsx
43+
.. _pyexcel-ods: https://github.com/chfw/pyexcel-ods
44+
.. _pyexcel-ods3: https://github.com/chfw/pyexcel-ods3
45+
.. _pyexcel-text: https://github.com/chfw/pyexcel-text
4646

4747
This library makes infomation processing involving various excel files as easy as processing array and dictionary. The information processing job includes when processing file upload/download, data import into and export from SQL databases, information analysis and persistence. It uses **pyexcel** and its plugins: 1) to provide one uniform programming interface to handle csv, tsv, xls, xlsx, xlsm and ods formats. 2) to provide one-stop utility to import the data in uploaded file into a database and to export tables in a database as excel files for file download 3) to provide the same interface for information persistence at server side: saving a uploaded excel file to and loading a saved excel file from file system.
4848

@@ -201,7 +201,7 @@ Write up the view functions for data import::
201201
request.save_book_to_database(field_name='file', session=db.session,
202202
tables=[Category, Post],
203203
initializers=(category_init_func,
204-
post_init_func])
204+
post_init_func])
205205
return "Saved"
206206
return '''
207207
<!doctype html>
@@ -212,6 +212,11 @@ Write up the view functions for data import::
212212
</form>
213213
'''
214214

215+
In the code, `category_init_func` and `post_init_func` are custom initialization functions for
216+
Category and Post respectively. In the situation where you want to skip certain rows, None should
217+
should be returned and flask_excel will ignore the row.
218+
219+
215220
Write up the view function for data export::
216221

217222
@app.route("/export", methods=['GET'])
@@ -261,7 +266,7 @@ API Reference
261266

262267
**Flask-Excel** attaches **pyexcel** functions to **Request** class.
263268

264-
.. module:: flask_excel.request
269+
.. module:: flask_excel.ExcelRequest
265270

266271
ExcelRequest
267272
******************
@@ -322,7 +327,7 @@ ExcelRequest
322327
.. method:: save_to_database(field_name=None, session=None, table=None, initializer=None, mapdict=None **keywords)
323328

324329
:param field_name: same as :meth:`~flask_excel.ExcelRequest.get_sheet`
325-
:param session: a SQLAlchemy session
330+
:param session: a SQLAlchemy session
326331
:param table: a database table
327332
:param initializer: a custom table initialization function if you have one
328333
:param mapdict: the explicit table column names if your excel data do not have the exact column names

0 commit comments

Comments
 (0)