Skip to content

Lightweight XLSX writer with emphasis on minimizing memory usage.

License

Notifications You must be signed in to change notification settings

nyaruka/xlsxlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XLSXLite

Build Status Coverage Status PyPI Release

This is a lightweight XLSX writer with emphasis on minimizing memory usage. It's also really fast.

from xlsxlite.writer import XLSXBook
book = XLSXBook()
sheet1 = book.add_sheet("People")
sheet1.append_row("Name", "Email", "Age")
sheet1.append_row("Jim", "[email protected]", 45)
book.finalize(to_file="simple.xlsx")

Benchmarks

The benchmarking test writes rows with 10 cells of random string data to a single sheet workbook. The table below gives the times in seconds (lower is better) to write a spreadsheet with the given number of rows, and includes xlxswriter and openpyxl for comparison.

Implementation 100,000 rows 1,000,000 rows
openpyxl 43.5 469.1
openpyxl + lxml 21.1 226.3
xlsxwriter 17.2 186.2
xlsxlite 1.9 19.2

Limitations

This library is for projects which need to generate large spreadsheets, quickly, for the purposes of data exchange, and so it intentionally only supports a tiny subset of SpreadsheetML specification:

  • No styling or themes
  • Only strings, numbers, booleans and dates are supported cell types

If you need to do anything fancier then take a look at xlxswriter and openpyxl.

Development

To run all tests:

poetry run py.test xlsxlite -s

About

Lightweight XLSX writer with emphasis on minimizing memory usage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages