~tuxpup/xlsx-dict-reader

Implementation of csv.DictReader for excel files
add CHANGELOG.
bump version to 0.3.0
Strip leading and trailing whitespace from header field names by default. Fixes #1.

clone

read-only
https://git.sr.ht/~tuxpup/xlsx-dict-reader
read/write
git@git.sr.ht:~tuxpup/xlsx-dict-reader

You can also use your local clone with git send-email.

#XLSX DictReader

This is a simple Python module that takes an openpyxl Worksheet object and returns a list of dictionaries. Each dictionary represents a row in the Excel file. The keys of the dictionary are the column names and the values are the cell values.

I've recently found myself, several times, wanting a thing like csv.DictReader for specific ranges of cells in Excel files. This does the job for me so far.

Sample Usage:

from openpyxl import load_workbook
from xlsx_dictreader import DictReader

wb = load_workbook('sample.xlsx', data_only=True)
ws = wb.active


reader = DictReader(ws, skip_blank=True)
for row in reader:
    print(row)