A simple package to read openpyxl worksheets like a csv DictReader
Project description
openpyxl-dictreader
Description
A module that maps the information in each row in an openpyxl worksheet to a dict whose keys are given by the optional fieldnames parameter, similar to Python's native csv.DictReader.
Installing
pip install openpyxl-dictreader
Examples
Input:
import openpyxl_dictreader
reader = openpyxl_dictreader.DictReader("names.xlsx", "Sheet1")
for row in reader:
print(row["First Name"], row["Last Name"])
Output:
Boris Johnson
Donald Trump
Mark Rutte
load_workbook keyword arguments
The openpyxl load_workbook method takes several optional keyword arguments. These can be passed into the openpyxl_dictreader.DictReader constructor as keyword arguments:
reader = openpyxl_dictreader.DictReader("names.xlsx", "Sheet1", read_only=False, keep_vba=False, data_only=False, keep_links=True)
Acknowledgements
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
Built Distribution
Close
Hashes for openpyxl-dictreader-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21dfe73b9c996cdf1550c6568ff3d08b76fb712f95e6e6f03499c21201cdb40f |
|
MD5 | 45b969f38b95b6398dad7d43ce5596c4 |
|
BLAKE2b-256 | 2b8889aa9003afb5b2ab442ad75c27a074da0b17609fef7573c7af5d44c6bad6 |
Close
Hashes for openpyxl_dictreader-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9192cf7b322c684e2a9a58edd465c2d5c150a0cd12b792d27ffacaa0f285bfc0 |
|
MD5 | 07966bdbb407e369d28dd257ca731f33 |
|
BLAKE2b-256 | d3a8670d7c8f7c047c547fdfddd7f4a91d0d22f0932a7de8eac14346417daf1f |