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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd7faef047ca819f72f6d8f01752f3b8b700e3d9bcf3a7e7edf54d71d89b1e4 |
|
MD5 | 6e9d6b95e406897100b8b84ce40a4d36 |
|
BLAKE2b-256 | 36ccb69d4ae2307afac06d79b0baa370b0920a51221dbf7ee6dac90e0bab0707 |
Close
Hashes for openpyxl_dictreader-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0520850654f5c1fbb2a31d46d5c10b6f4788ea4b13f638a3790a8e13868512a |
|
MD5 | c134ed454147ec2ed3c89cdb75eca0a9 |
|
BLAKE2b-256 | 8ad90eb9731613ea089af503a4c6e033c6c7ee9362c654ecabb4877649396e07 |