Skip to main content

An interface similar to csv.DictReader for openpyxl WorkSheet objects

Project description

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)

Project details


Download files

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

Source Distribution

xlsx_dict_reader-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

xlsx_dict_reader-0.3.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file xlsx_dict_reader-0.3.0.tar.gz.

File metadata

  • Download URL: xlsx_dict_reader-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for xlsx_dict_reader-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a2e6fab692ddd3c06ae373a0792217668e35f95f87d3fd67b0d5491129e3749d
MD5 b73fca0801954a82ad396c8890a8f1fc
BLAKE2b-256 cb17d9014066bf2541c7fc482776d8ce6c0662bcfd177b647ca77ab9dbe5edbe

See more details on using hashes here.

File details

Details for the file xlsx_dict_reader-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: xlsx_dict_reader-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for xlsx_dict_reader-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0731aeeb056d816d0efdd0816d94282c36b37570ed52df8c8847c80f86e76653
MD5 cfcdea324e2b234f8abe48d08dbab853
BLAKE2b-256 7583f774c6c0775094b8da0bec6c64b4d54183c2a2acc5f5f086431adb26408c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page