>>>importpyexcel>>># make sure you had pyexcel-xls installed>>>a_list_of_dictionaries=[...{..."Name":'Adam',..."Age":28...},...{..."Name":'Beatrice',..."Age":29...},...{..."Name":'Ceri',..."Age":30...},...{..."Name":'Dean',..."Age":26...}...]>>>pyexcel.save_as(records=a_list_of_dictionaries,dest_file_name="your_file.xls")

And here’s how to obtain the records:

>>>importpyexcelasp>>>records=p.iget_records(file_name="your_file.xls")>>>forrecordinrecords:...print("%s is aged at %d"%(record['Name'],record['Age']))Adamisagedat28Beatriceisagedat29Ceriisagedat30Deanisagedat26>>>p.free_resources()

In order to manage the list of plugins installed, you need to use pip to add or remove
a plugin. When you use virtualenv, you can have different plugins per virtual
environment. In the situation where you have multiple plugins that does the same thing
in your environment, you need to tell pyexcel which plugin to use per function call.
For example, pyexcel-ods and pyexcel-odsr, and you want to get_array to use pyexcel-odsr.
You need to append get_array(…, library=’pyexcel-odsr’).

0.5.3 - 01-08-2017

0.5.2 - 26-07-2017

Updated

embeded the enabler for pyexcel-htmlr. http source does not support text/html
as mime type.

0.5.1 - 12.06.2017

Updated

support saving SheetStream and BookStream to database targets. This is needed
for pyexcel-webio and its downstream projects.

0.5.0 - 19.06.2017

Added

Sheet.top() and Sheet.top_left() for data browsing

add html as default rich display in Jupyter notebook when pyexcel-text
and pyexcel-chart is installed

add svg as default rich display in Jupyter notebook when pyexcel-chart and
one of its implementation plugin(pyexcel-pygal, etc.) are is installed

new dictionary source supported: a dictionary of key value pair could be
read into a sheet.

added dynamic external plugin loading. meaning if a pyexcel plugin
is installed, it will be loaded implicitly. And this change would remove
unnecessary info log for those who do not use pyexcel-text and pyexcel-gal

save_book_as before 0.5.0 becomes isave_book_as and save_book_as in 0.5.0
convert BookStream to Book before saving.

#83, file closing mechanism
is enfored. free_resource is added and it should be called when iget_array,
iget_records, isave_as and/or isave_book_as are used.

Updated

array is passed to pyexcel.Sheet as reference. it means your array data will
be modified.

Removed

pyexcel.Writer and pyexcel.BookWriter were removed

pyexcel.load_book_from_sql and pyexcel.load_from_sql were removed

pyexcel.deprecated.load_from_query_sets,
pyexcel.deprecated.load_book_from_django_models and
pyexcel.deprecated.load_from_django_model were removed

Removed

remove get_{{file_type}}_stream functions from pyexcel.Sheet and
pyexcel.Book introduced since 0.4.3.

0.4.3 - 26.01.2017

Added

‘.stream’ attribute are attached to ~pyexcel.Sheet and
~pyexcel.Book to get direct access the underneath stream
in responding to file type attributes, such as sheet.xls. it helps provide a custom
stream to external world, for example, Sheet.stream.csv gives a text stream
that contains csv formatted data. Book.stream.xls returns a xls format
data in a byte stream.

Updated

Better error reporting when an unknown parameters or unsupported file types
were given to the signature functions.

0.4.2 - 17.01.2017

Updated

Raise exception if the incoming sheet does not have column names. In other
words, only sheet with column names could be saved to database. sheet with
row names cannot be saved. The alternative is to transpose the sheet, then
name_columns_by_row and then save.

fix iget_records where a non-uniform content should be given,
e.g. [[“x”, “y”], [1, 2], [3]], some record would become non-uniform, e.g.
key ‘y’ would be missing from the second record.

skip_empty_rows is applicable when saving a python data structure to
another data source. For example, if your array contains a row which is
consisted of empty string, such as [‘’, ‘’, ‘’ … ‘’], please specify
skip_empty_rows=False in order to preserve it. This becomes subtle when
you try save a python dictionary where empty rows is not easy to be spotted.