Install & Compatibility
Where this runs
tested against v4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.726s · 171.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 9.0s · import 1.614s · 164MB
176MB installed
● package 176MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
StyleFrame
✓ from styleframe import StyleFrame
✗ from StyleFrame import StyleFrame
Package name is lowercase 'styleframe' since v3.0.1.
Styler
✓ from styleframe import Styler
utils
✓ from styleframe import utils
Submodule for colors, borders, etc.
Create a styled Excel file with StyleFrame.
from styleframe import StyleFrame, Styler, utils
import pandas as pd
df = pd.DataFrame({'A': [1, 2], 'B': ['x', 'y']})
sf = StyleFrame(df)
styler = Styler(bg_color=utils.colors.yellow, bold=True)
sf.apply_style_by_indexes(sf.index, styler)
sf.to_excel('styled.xlsx').save()
print('Excel file created.')
Errors
Common errors & fixes
ImportError: cannot import name 'StyleFrame' from 'StyleFrame'
Package was renamed to lowercase 'styleframe' in v3.0.1. Old import path no longer works.
fixUse `from styleframe import StyleFrame`.
AttributeError: module 'styleframe' has no attribute 'ExcelWriter'
Before v4.1, ExcelWriter was not exposed at module level.
fixUse `from styleframe import StyleFrame` and access `StyleFrame.ExcelWriter`.
Upgrade
Version history
4.2latest on PyPI · released Nov 13, 2023
Audit
Dependencies
pandasrequiredCore dependency for DataFrame operations.
openpyxlrequiredRequired for Excel styling and writing.