Skip to main content

Extract data from Excel documents.

Project description

exex Build Status Code style: black

Extract data from Excel documents


pip install exex


Sample Excel file

from openpyxl import load_workbook
from exex import parse

book = load_workbook("sample.xlsx") # load excel file
sheet = # get active sheet

# single cell by name

# single cell by row/column number
parse.values(sheet.cell(row=1, column=1)) 
# range of cells
  ["name", "abbreviation"],
  ["alpha", "a"],

# all values              
  ["name", "abbreviation", "age"],
  ["alpha", "a", 1],
  ["beta", "b", 2],
  ["gamma", "g", 3],

# row by number                  
["alpha", "a", 1]
# range of rows           
  ["name", "abbreviation", "age"],
  ["alpha", "a", 1],

# column by name            
["name", "alpha", "beta", "gamma"]

# column range
  ["name", "alpha"],
  ["abbreviation", "a"],

Ways to access sheets

# Sheets
book.sheets[0]                # (sheet) sheet by index
book.sheets["prices"]         # (sheet) sheet by name                   # (sheet) active sheet

book.sheetnames               # (array) sheet names


Tests (local Python version)

poetry run pytest

Tests (all Python versions defined in tox.ini)

poetry run tox

Code formatting (black)

poetry run black .

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for exex, version 0.1.7
Filename, size File type Python version Upload date Hashes
Filename, size exex-0.1.7-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size exex-0.1.7.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page