Core API

Although each module is documented separately (xl.range,, etc.), the top-level xl package imports the most important pieces. Most users only need to import xl.


Pyvot - Pythonic interface for data exploration in Excel

The user-level API for the xl package follows. For interactive use, consider running the interactive shell:

python -m
Managing Excel workbooks:
  • xl.Workbook() opens a new workbook
  • xl.Workbook(“filename”) attaches to an existing workbook, or opens it
  • xl.workbooks() returns a Workbook for each that is currently open
Excel Ranges:
  • / xl.apply / xl.filter operate like their Python counterparts, but read and write from an Excel workbook from xl import * imports xlmap(), etc. instead, to avoid overriding builtins.
  • xl.join() allows joining two Excel tables by a pair of key columns
  • xl.get() fetches a Range for a table column (by column name), named Excel range, or for an Excel address (ex. A1:B1). It attempts to guess the active Workbook, and begins looking in the active sheet. See also Workbook.get
  • xl.view() splats a list of Python values to an empty column in Excel
  • xl.selected_range() / xl.selected_value() provide the active sheet’s selection

Table Of Contents

Previous topic

The Pyvot API

Next topic - map(), filter(), and other top-level utilities

This Page