Comparison of Python Packages Related to Excel
|
Python Package
|
Description
|
|
xlrd
|
Supports reading `.xls` and `.xlsx` files
|
|
xlwt
|
Supports writing `.xls` files
|
|
OpenPyXl
|
Supports reading and writing `.xlsx`, `.xlsm`, `.xltx`, `.xltm` files, supports the Excel object model, and does not depend on Excel
|
|
XlsxWriter
|
Supports writing `.xlsx` files, supports VBA
|
|
win32com
|
Encapsulates all Excel objects used by VBA
|
|
comtypes
|
Encapsulates all Excel objects used by VBA
|
|
xlwings
|
Rewraps Win32COM, supports mixed programming with VBA, and supports data type conversion between various data types
|
|
pandas
|
Supports reading and writing `.xls` and `.xlsx` files, provides various data processing functions, simpler processing, and faster speed
|
OpenPyXl(Does not depend on Excel)
win32com:xlwings predecessor, encapsulates VBA object model, Windows platform
xlwings:Powerful, platform-independent
pandas:Based on NumPy, fast, data cleaning
Excel Objects and Their Hierarchy
Application Object
Workbooks Collection Object
Workbook Object
Worksheets Collection Object
Worksheet Object
Range Obejct
Installation of xlwings Package
- Install directly online. In PowerShell, type:
pip install xlwings
Press Enter.
- For offline installation, visit the URL:
https://pypi.org/
Download the corresponding version and 32/64-bit installation file, then install it.