import pandas as pd
excel_file = “전체카테고리_가격정리.xlsx”
xl = pd.ExcelFile(excel_file)
# 연두리빙(Yeondu Living) 브랜드에 맞춘 싱그럽고 고급스러운 연두/그린 톤 & 세련된 UI 디자인 CSS
html_header = “””
연두리빙 2026 추석 명절 선물세트 특별 제안전
“””
css_style = “””
“””
# 카테고리 ID 및 아이콘 매핑
cat_meta = {
‘한우’: (‘cat-hanwoo’, ‘🥩’, ‘프리미엄 1++ 한우 및 LA 갈비 선물세트’),
‘곶감’: (‘cat-gotgam’, ‘🍊’, ‘상주 / 산청 전통 곶감 및 호두말이 세트’),
‘김선물세트’: (‘cat-kim’, ‘🌊’, ‘명품 광천김 / 박향희 손구이 수제김 세트’),
‘농산물세트’: (‘cat-farm’, ‘🍎’, ‘산지직송 명품 과일 / 버섯 / 견과 선물세트’),
‘가공식품(유지류)세트’: (‘cat-oil’, ‘🫒’, ‘프리미엄 엑스트라버진 오일 및 전통 참/들기름 세트’),
‘건강식품’: (‘cat-health’, ‘🍯’, ‘천연 벌꿀스틱 / 6년근 고려홍삼 / 침향환 세트’),
‘육포세트’: (‘cat-jerky’, ‘🥓’, ‘국내산 수제 소고기육포 & 한우육포 세트’),
‘쌍계명차(특판전용)’: (‘cat-tea’, ‘🍵’, ‘김동곤 명인 전통 명차 & 다도 컬렉션’)
}
sections_html = []
for sheet_name in xl.sheet_names:
df = pd.read_excel(excel_file, sheet_name=sheet_name)
cid, icon, desc = cat_meta.get(sheet_name, (‘cat-misc’, ‘🎁’, ‘추석 명절 선물세트’))
cols = df.columns.tolist()
name_col = next((c for c in cols if ‘상품명’ in str(c)), None)
spec_col = next((c for c in cols if ‘구성’ in str(c) or ‘규격’ in str(c)), None)
mfr_col = next((c for c in cols if ‘제조원’ in str(c) or ‘브랜드’ in str(c)), None)
retail_col = next((c for c in cols if ‘소비자가’ in str(c) or ‘정상가’ in str(c)), None)
rec_col = next((c for c in cols if ‘시장 적정 판매가’ in str(c)), None)
tax_col = next((c for c in cols if ‘구분’ in str(c) or ‘과세’ in str(c)), None)
table_rows = []
for idx, row in df.iterrows():
p_name = str(row[name_col]) if name_col and pd.notna(row[name_col]) else “”
p_spec = str(row[spec_col]) if spec_col and pd.notna(row[spec_col]) else “”
p_mfr = str(row[mfr_col]) if mfr_col and pd.notna(row[mfr_col]) else “”
p_retail = f”{int(row[retail_col]):,}원” if retail_col and pd.notna(row[retail_col]) and isinstance(row[retail_col], (int, float)) else “-”
p_rec = f”{int(row[rec_col]):,}원” if rec_col and pd.notna(row[rec_col]) and isinstance(row[rec_col], (int, float)) else “-”
tax_val = str(row[tax_col]) if tax_col and pd.notna(row[tax_col]) else “”
tax_badge = “”
if “면세” in tax_val:
tax_badge = ‘면세‘
elif “과세” in tax_val:
tax_badge = ‘과세‘
row_html = f”””
{idx + 1}
{p_name} {tax_badge}
{p_spec}
{p_mfr}
{p_retail}
{p_rec}
“””
table_rows.append(row_html)
section = f”””
총 {len(df)}개 품목
“””
sections_html.append(section)
html_footer = “””
“””
full_html = css_style + “\n” + html_header + “\n” + “\n”.join(sections_html) + “\n” + html_footer
with open(“연두리빙_2026추석_전체통합_선물세트_워드프레스.html”, “w”, encoding=”utf-8″) as f:
f.write(full_html)
print(“Full Integrated HTML successfully generated! Total size:”, len(full_html))
2026 CHUSEOK GIFT SPECIAL
🌿 연두리빙 2026 추석 명절 선물세트 특별 제안전
정성과 품격을 담은 프리미엄 명절 선물, 연두리빙 특별 제안가로 만나보세요.
{icon} {sheet_name}
{desc}| No | 상품명 | 구성 및 규격 | 브랜드/제조원 | 정상가 | 연두리빙 특별가 |
|---|