Registry / data / styleframe

styleframe

JSON →
library4.2pypypi✓ verified 85d ago

A library that wraps pandas and openpyxl to allow easy styling of DataFrames in Excel. Current version: 4.2. Supports Python 3.6+ (dropped Python 3.4/3.5 in 4.0.0). Regular releases; last update January 2022.

pip install styleframe
INSTALL
IMPORT
SIG · STYLEFRAME
S
styleframe
datapythonv4.2
Install
9.0s avg
Import
1670ms
Disk
176MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.726s · 171.6MB
glibc
py 3.103.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.')
Debug
Known issues
breakingPackage name changed from 'StyleFrame' to 'styleframe' (all lowercase) in v3.0.1. Old imports will fail.
fix
Use `from styleframe import StyleFrame` instead of `from StyleFrame import StyleFrame`.
affects: <3.0.1
breakingPython 3.4 and 3.5 support removed in v4.0.0.
fix
Upgrade to Python 3.6+.
affects: <4.0.0
deprecatedUsing non-openpyxl engine in `to_excel` raises TypeError since v4.1.
fix
Ensure you are using openpyxl engine. Default is openpyxl.
affects: >=4.1
gotchaWhen using `to_excel` with `header=False`, rows may be misaligned before v4.0.0.
fix
Upgrade to v4.0.0+.
affects: <4.0.0
gotcha`best_fit` argument in `to_excel` caused an error on empty DataFrames before v4.2.
fix
Upgrade to v4.2 or avoid using best_fit on empty DataFrames.
affects: <4.2
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.
fix
Use `from styleframe import StyleFrame`.
AttributeError: module 'styleframe' has no attribute 'ExcelWriter'
Before v4.1, ExcelWriter was not exposed at module level.
fix
Use `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.
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
styleframe — pip install styleframe · libregistry