i create utility for style excel

42 views
Skip to first unread message

Nima Orangi

unread,
Aug 20, 2025, 4:07:16 AMAug 20
to openpyxl-users
Hi everyone 👋

If you often work with Excel files in Python and find styling a bit painful, I’ve just released a new package called **ExcelStyler** 📊✨

👉 PyPI: https://pypi.org/project/excelstyler/  
👉 GitHub: (add your repo link here)

ExcelStyler makes it super easy to add professional styles to Excel files:
- 🎨 Custom fonts, colors, and borders
- 📑 Automatic header and table formatting
- 📈 Smooth integration with pandas DataFrames
- âš¡ Lightweight and fast (built on top of openpyxl/xlsxwriter)

# excelstyler

`excelstyler` is a Python package that makes it easy to style and format Excel worksheets using [openpyxl](https://openpyxl.readthedocs.io).

## Installation
```bash
pip install excelstyler
```

## Example
```python
from excelstyler.styles import GREEN_CELL
from excelstyler.utils import shamsi_date
from excelstyler.headers import create_header

import openpyxl

output = BytesIO()
workbook = Workbook()
worksheet = workbook.active
worksheet.sheet_view.rightToLeft = True   # if you iranian else False
worksheet.insert_rows(1)
create_header(ws, ["Name", "Score"], 1, 1, color='green')
workbook.save(output)
output.seek(0)

response = HttpResponse(
  content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
response[
  'Content-Disposition'] = f'attachment; filename="test file.xlsx"'.encode(
  'utf-8') # support from persian
response.write(output.getvalue())
return response
```
Reply all
Reply to author
Forward
0 new messages