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 get_fods(**__)fods getter is not defined. Book.get_gridget_handsontable(**keywords)Get data in handsontable format get_handsontable_html(**keywords)Get data in handsontable.html format Book.get_htmlBook.get_jsonBook.get_latexBook.get_latex_booktabsBook.get_mediawikiBook.get_ndjsonget_ods(**keywords)Get data in ods format Book.get_orgtblBook.get_pipeBook.get_plainget_records(**keywords)Get data in records format Book.get_rstBook.get_simpleget_svg(**keywords)Get data in svg format 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(**__)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])indpendent function so that it could be called multiple times load_from_sheets(sheets)Load content from existing sheets number_of_sheets()Return the number of sheets plot([file_type])Visualize the data register_inputpartial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. register_iopartial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. register_presentationpartial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. remove_sheet(sheet)Remove a sheet save_as(filename, **keywords)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 set_fods(content, **keywords)Set data in fods format Book.set_gridset_handsontable(_y, **_z)handsontable setter is not defined. set_handsontable_html(_y, **_z)handsontable.html setter is not defined. Book.set_htmlBook.set_jsonBook.set_latexBook.set_latex_booktabsBook.set_mediawikiBook.set_ndjsonset_ods(content, **keywords)Set data in ods format Book.set_orgtblBook.set_pipeBook.set_plainset_records(content, **keywords)Set data in records format Book.set_rstBook.set_simpleset_svg(_y, **_z)svg setter is not defined. set_texttable(_y, **_z)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 sort_sheets([key, reverse])to_dict()Convert the book to a dictionary Attributes
arrayGet/Set data in/from array format bookdictGet/Set data in/from bookdict format csvGet/Set data in/from csv format csvzGet/Set data in/from csvz format dictGet/Set data in/from dict format fodsSet data in fods format Book.gridhandsontableGet data in handsontable format handsontable_htmlGet data in handsontable.html format Book.htmlBook.jsonBook.latexBook.latex_booktabsBook.mediawikiBook.ndjsonodsGet/Set data in/from ods format Book.orgtblBook.pipeBook.plainrecordsGet/Set data in/from records format Book.rstBook.simplestreamReturn a stream in which the content is properly encoded svgGet data in svg format texttableGet data in texttable format tsvGet/Set data in/from tsv format tsvzGet/Set data in/from tsvz format urlSet data in url format xlsGet/Set data in/from xls format xlsmGet/Set data in/from xlsm format xlsxGet/Set data in/from xlsx format -