Extract data from Excel documents.
Project description
exex
Extract data from Excel documents
Installation
pip install exex
Usage
Use openpyxl
to grab data
from openpyxl import load_workbook
book = load_workbook("sample.xlsx")
# Sheets
book.sheetnames # (array) sheet names
book.sheets[0] # (sheet) first sheet
book.sheets["prices"] # (sheet) sheet by name
book.active # (sheet) active sheet
# Grab cells from active sheet
sheet = book.active
sheet["A1"] # (value) single cell by name
sheet.cell(row=1, column=1) # (value) single cell by row/column
sheet["A1":"B2"] # (array) range of cells
sheet.values # (array) all cells
sheet[5] # (array) single row
sheet[5:10] # (array) range of rows
sheet["C"] # (array) single column
sheet["A:C"] # (array) range of columns
Use exex.parse.values()
to get values
from exex import parse
parse.values(sheet["A1"])
parse.values(sheet.cell(row=1, column=1))
parse.values(sheet["A1":"B2"])
parse.values(sheet.values)
parse.values(sheet[5])
parse.values(sheet[5:10])
parse.values(sheet["C"])
parse.values(sheet["A:C"])
Development
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
exex-0.1.6.tar.gz
(3.2 kB
view hashes)
Built Distribution
exex-0.1.6-py3-none-any.whl
(3.1 kB
view hashes)