API Reference
This is intended for users of pyexcel.
Signature functions
Obtaining data from excel file
|
Obtain an array from an excel source |
|
Obtain a dictionary from an excel source |
|
Obtain a list of records from an excel source |
|
Obtain a dictionary of two dimensional arrays |
|
Get an instance of |
|
Get an instance of |
|
Get an instance of |
|
Obtain a generator of an two dimensional array from an excel source |
|
Obtain a generator of a list of records from an excel source |
Close file handles opened by signature functions that starts with 'i' |
Saving data to excel file
|
Save a sheet from a data source to another one |
|
Save a sheet from a data source to another one with less memory |
|
Save a book from a data source to another one |
|
Save a book from a data source to another one |
These flags can be passed on all signature functions:
auto_detect_int
Automatically convert float values to integers if the float number has no decimal values(e.g. 1.00). By default, it does the detection. Setting it to False will turn on this behavior
It has no effect on pyexcel-xlsx because it does that by default.
auto_detect_float
Automatically convert text to float values if possible. This applies only pyexcel-io where csv, tsv, csvz and tsvz formats are supported. By default, it does the detection. Setting it to False will turn on this behavior
auto_detect_datetime
Automatically convert text to python datetime if possible. This applies only pyexcel-io where csv, tsv, csvz and tsvz formats are supported. By default, it does the detection. Setting it to False will turn on this behavior
library
Name a pyexcel plugin to handle a file format. In the situation where multiple plugins were pip installed, it is confusing for pyexcel on which plugin to handle the file format. For example, both pyexcel-xlsx and pyexcel-xls reads xlsx format. Now since version 0.2.2, you can pass on library=”pyexcel-xls” to handle xlsx in a specific function call.
It is better to uninstall the unwanted pyexcel plugin using pip if two plugins for the same file type are not absolutely necessary.
Cookbook
|
merge a list of csv files into a excel book |
|
merge a list of excel files into a excel book |
|
Split a file into separate sheets |
|
Extract a sheet from a excel book |
Book
Here’s the entity relationship between Book, Sheet, Row and Column

Constructor
|
Read an excel book that has one or more sheets |
Attribute
Return the number of sheets |
|
Return all sheet names |
Conversions
Get/Set data in/from bookdict format |
|
Set data in url format |
|
Get/Set data in/from csv format |
|
Get/Set data in/from tsv format |
|
Get/Set data in/from csvz format |
|
Get/Set data in/from tsvz format |
|
Get/Set data in/from xls format |
|
Get/Set data in/from xlsm format |
|
Get/Set data in/from xlsx format |
|
Get/Set data in/from ods format |
|
Return a stream in which the content is properly encoded |
Save changes
|
Save the content to a new file |
|
Save the content to a memory stream |
|
Save data in sheets to database tables |
|
Save to database table through django model |
Sheet
Constructor
|
Two dimensional data container for filtering, formatting and iteration |
Attributes
Plain representation without headers |
|
The number of rows |
|
The number of columns |
|
Utility function to get row range |
|
Utility function to get column range |
Cell access
|
Random access to table cells |
|
By default, this class recognize from top to bottom from left to right |
Row access
|
Gets the data at the specified row |
|
Update a row data range |
|
Delete one or more rows |
|
Take ordereddict to extend named rows |
Column access
|
Gets the data at the specified column |
|
Updates a column data range |
|
Delete one or more columns |
|
Take ordereddict to extend named columns |
Data series
Any column as row name
|
Use the elements of a specified row to represent individual columns |
Return row names if any |
|
|
Get a column by its name |
|
Take the first row as column names |
Works only after you named columns by a row |
Any row as column name
|
Use the elements of a specified column to represent individual rows |
Return column names if any |
|
|
Get a row by its name |
|
Take the first column as row names |
Take the first column as row names |
Conversion
Get/Set data in/from array format |
|
Get/Set data in/from records format |
|
Get/Set data in/from dict format |
|
Set data in url format |
|
Get/Set data in/from csv format |
|
Get/Set data in/from tsv format |
|
Get/Set data in/from csvz format |
|
Get/Set data in/from tsvz format |
|
Get/Set data in/from xls format |
|
Get/Set data in/from xlsm format |
|
Get/Set data in/from xlsx format |
|
Get/Set data in/from ods format |
|
Return a stream in which the content is properly encoded |
Formatting
|
Apply a formatting action for the whole sheet |
Filtering
|
Apply the filter with immediate effect |
Transformation
|
Rearrange the sheet. |
Rotate the data table by 90 degrees |
|
|
Execute a function across all cells of the sheet |
|
Get a rectangle shaped data out |
|
Get a rectangle shaped data out and clear them in position |
|
Paste a rectangle shaped data after a position |
Save changes
|
Save the content to a named file |
|
Save the content to memory |
|
Save data in sheet to database table |
|
Save to database table through django model |