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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for openpyxl_dictreader-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf10dd1fbe05ef900e79f2661bdbaa1e2f58d445a7964162453b068434331041 |
|
MD5 | 331ee9f2e6694bcfd33f9d7d8f72e5d8 |
|
BLAKE2b-256 | 6b9785b8a07895630686f6f2807b7b2b1361e5696b2e56ca8505d40c501549e3 |