openpyxl-image-loader
raw JSON → 1.0.5 verified Mon Apr 27 auth: no python
Openpyxl wrapper that simplifies extracting images from Excel cells. Version 1.0.5 with infrequent releases.
pip install openpyxl-image-loader Common errors
error ImportError: No module named 'openpyxl_image_loader' ↓
cause Library not installed or installed under different name.
fix
Run: pip install openpyxl-image-loader
error AttributeError: type object 'OpenpyxlImageLoader' has no attribute 'get' ↓
cause Incorrectly instantiating the class as a type rather than an instance.
fix
Import and use: from openpyxl_image_loader import OpenpyxlImageLoader then create instance: loader = OpenpyxlImageLoader(worksheet)
error TypeError: get() missing 1 required positional argument: 'cell' ↓
cause Calling get without cell argument.
fix
Call: image_loader.get('A1') with a valid cell string.
Warnings
gotcha The library only supports cell references as strings (e.g., 'A1'), not tuples or Row/Column objects. ↓
fix Pass cell address as a string like 'B2'.
deprecated The get() method returns None if no image is found; do not assume an image always exists. ↓
fix Always check if image is not None before using it.
gotcha The library does not handle merged cells with images; images anchored to merged ranges may not be found. ↓
fix Unmerge cells or manually iterate over cell range.
Imports
- OpenpyxlImageLoader wrong
from openpyxl_image_loader import ImageLoadercorrectfrom openpyxl_image_loader import OpenpyxlImageLoader
Quickstart
from openpyxl import load_workbook
from openpyxl_image_loader import OpenpyxlImageLoader
wb = load_workbook('example.xlsx')
ws = wb.active
image_loader = OpenpyxlImageLoader(ws)
image = image_loader.get('A1') # returns PIL Image or None
if image:
image.save('extracted_image.png')