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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a10f7f8e1133ee0803f6b2a1a3e5eb8230565fdc56e65706ed654d6b3a226cde |
|
MD5 | bd664c8bd9760b4a843a273bba896f45 |
|
BLAKE2b-256 | 8156d99099b6ca50058411158bfc527b82dd6aef76cc77e324056789c0c28964 |
Close
Hashes for openpyxl_dictreader-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec761eb54193e6fe6718a85d5f605427944f59166fb7b9ef60583ba2c7783fa9 |
|
MD5 | 2e3659ce2aefa6379a242549892d70da |
|
BLAKE2b-256 | 287488f455a656258623ac8ea5e1498f549a2d46287e89fc4e9d894f73b697a2 |