pyexcel.Book¶
-
class
pyexcel.
Book
(sheets=None, filename='memory', path=None)[source]¶ Read an excel book that has one or more sheets
For csv file, there will be just one sheet
-
__init__
(sheets=None, filename='memory', path=None)[source]¶ Book constructor
Selecting a specific book according to filename extension
Parameters: - sheets – a dictionary of data
- filename – the physical file
- path – the relative path or absolute path
- keywords – additional parameters to be passed on
Methods
__init__
([sheets, filename, path])Book constructor get_array
(**keywords)Get data in array format get_bookdict
(**keywords)Get data in bookdict format get_csv
(**keywords)Get data in csv format get_csvz
(**keywords)Get data in csvz format get_dict
(**keywords)Get data in dict format Book.get_grid
Book.get_html
Book.get_json
Book.get_latex
Book.get_latex_booktabs
Book.get_mediawiki
get_ods
(**keywords)Get data in ods format Book.get_orgtbl
Book.get_pipe
Book.get_plain
get_records
(**keywords)Get data in records format Book.get_rst
Book.get_simple
Book.get_svg
get_texttable
(**keywords)Get data in texttable format get_tsv
(**keywords)Get data in tsv format get_tsvz
(**keywords)Get data in tsvz format get_url
(**keywords)url getter is not defined. get_xls
(**keywords)Get data in xls format get_xlsm
(**keywords)Get data in xlsm format get_xlsx
(**keywords)Get data in xlsx format init
([sheets, filename, path])load_from_sheets
(sheets)Load content from existing sheets number_of_sheets
()Return the number of sheets register_book_input
(file_type)partial(func, *args, **keywords) - new function with partial application register_io
(file_type)partial(func, *args, **keywords) - new function with partial application register_presentation
(file_type[, ...])partial(func, *args, **keywords) - new function with partial application remove_sheet
(sheet)Remove a sheet save_as
(filename)Save the content to a new file save_to_database
(session, tables[, ...])Save data in sheets to database tables save_to_django_models
(models[, ...])Save to database table through django model save_to_memory
(file_type[, stream])Save the content to a memory stream set_array
(content, **keywords)Set data in array format set_bookdict
(content, **keywords)Set data in bookdict format set_csv
(content, **keywords)Set data in csv format set_csvz
(content, **keywords)Set data in csvz format set_dict
(content, **keywords)Set data in dict format Book.set_grid
Book.set_html
Book.set_json
Book.set_latex
Book.set_latex_booktabs
Book.set_mediawiki
set_ods
(content, **keywords)Set data in ods format Book.set_orgtbl
Book.set_pipe
Book.set_plain
set_records
(content, **keywords)Set data in records format Book.set_rst
Book.set_simple
Book.set_svg
set_texttable
(content, **keywords)texttable setter is not defined. set_tsv
(content, **keywords)Set data in tsv format set_tsvz
(content, **keywords)Set data in tsvz format set_url
(content, **keywords)Set data in url format set_xls
(content, **keywords)Set data in xls format set_xlsm
(content, **keywords)Set data in xlsm format set_xlsx
(content, **keywords)Set data in xlsx format sheet_by_index
(index)Get the sheet with the specified index sheet_by_name
(name)Get the sheet with the specified name sheet_names
()Return all sheet names to_dict
()Convert the book to a dictionary Attributes
array
Get/Set data in/from array format bookdict
Get/Set data in/from bookdict format csv
Get/Set data in/from csv format csvz
Get/Set data in/from csvz format dict
Get/Set data in/from dict format Book.grid
Book.html
Book.json
Book.latex
Book.latex_booktabs
Book.mediawiki
ods
Get/Set data in/from ods format Book.orgtbl
Book.pipe
Book.plain
records
Get/Set data in/from records format Book.rst
Book.simple
stream
Return a stream in which the book content is properly encoded Book.svg
texttable
Get data in texttable format tsv
Get/Set data in/from tsv format tsvz
Get/Set data in/from tsvz format url
Set data in url format xls
Get/Set data in/from xls format xlsm
Get/Set data in/from xlsm format xlsx
Get/Set data in/from xlsx format -