1. Products
  2.   Editor
  3.   Python
  4.   Pyexcel-XLS
 
  

Open-Source Python XLS Editor Library

Free & Open Source Python library to create and edit Excel XLS files.

What is Pyexcel-XLS?

Pyexcel-XLS is an open-source Python library to create, open and modify Microsoft Excel XLS files. It is a sub-component of the Pyexcel library that has other components as well in addition to the Pyexcel-XLS. Pyexcel-XLS lets you work with the rows and columns of XLS file that you can edit and then save back the XLS file to disc. Pyexcel-XLS supports a number of Excel file formats for reading and writing with certain constraints.

Pyexcel-XLS Features

Following are some of the main features of Pyexcel-XLS API:

  • One application programming interface(API) to handle multiple data sources such as physical file, memory file, SQLAlchemy table, Django Model, and Python data structures: dictionary, records and array.
  • One API to read and write data in various excel file formats.
  • For large data sets, data streaming are supported. A genenerator can be returned to you. Checkout iget_records, iget_array, isave_as and isave_book_as.

Supported File Formats

Pyexcel-XLS supports the following file formats.

File FormatDefinition
csvcomma separated values
tsvtab separated values
csvza zip file that contains one or many csv files
tsvza zip file that contains one or many tsv files
xlsa spreadsheet file format created by MS-Excel 97-2003
xlsxMS-Excel Extensions to the Office Open XML SpreadsheetML File Format.
xlsman MS-Excel Macro-Enabled Workbook file
odsopen document spreadsheet
fodsflat open document spreadsheet
jsonjava script object notation
htmlhtml table of the data structure
simplesimple presentation
rstrStructured Text presentation of the data
mediawikimedia wiki table

Pyexcel API Overview

GitHub

GitHub Stats

Name:
Language:
Stars:
Forks:
License:
Repository was last updated at

Getting Started with Pyexcel-XLS

We can download the Pyexcel-XLS library from GitHub or using pip install command:

Installation

Installing Pyexcel-XLS is simple and can be done from terminal as shown below:

Installing Pyexcel-XLS


pip3 install Pyexcel-XLS

Pyexcel-XLS Python Code Examples

Examples using the Pyexcel-XLS Python library are as follow. You can use the FREE Excel XLS file template to try these examples.

Read and Save XLS file in Python

You can read an XLS file using the Pyexcel-XLS Python library and then save it back to disc using the save_as commadn of the API as shown in the folloiwng code sample.

Add a Row to Excel XLS using Python

Pyexcel-XLS allows you to add a row to the Excel XLS file using the get_sheet method on the Workbook class of the API. This adds a row next to the existing maximum row count of the XLS file as shown in the following code exmaple.

Add a Column to Excel XLS with Pyexcel-XLS

Just as you can add a row to an Excel XLS using Pyexcel-XLS API, you can add a column to the XLS file using the API. This is as shown in the following code sample.

Update Column Data in XLS file in Python

In addition to adding new column to an XLS file, you can also update the contents of an existing column using the Pyexcel-XLS API. This is done by accessing the column by its index and putting the data in this specific column.

Resources

  • Pyexcel Documentation
  • FREE Excel Template file
  • Conclusion

    Pyexcel-XLS API lets you work with XLS files from within your Python applications. It lets you read, edit and save back the modified XLS file using Python. Use the free template excel file above

    Similar Products

     English