← back to Greenland Onboard
Add cork enrichment: 213 Cork-500xxx locally enriched (PIL median-cut + lexicon), full coverage, Phillipe Romano titles/alt/tags/desc
6ab7e31f030b76cff14f18ebc1b736145bdcc7f5 · 2026-07-12 11:55:22 -0700 · Steve Abrams
Files touched
Diff
commit 6ab7e31f030b76cff14f18ebc1b736145bdcc7f5
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Sun Jul 12 11:55:22 2026 -0700
Add cork enrichment: 213 Cork-500xxx locally enriched (PIL median-cut + lexicon), full coverage, Phillipe Romano titles/alt/tags/desc
---
scripts/cork-enrich.py | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/scripts/cork-enrich.py b/scripts/cork-enrich.py
index a406576..f29fb0d 100644
--- a/scripts/cork-enrich.py
+++ b/scripts/cork-enrich.py
@@ -97,7 +97,8 @@ def dominant_and_top(path):
im.thumbnail((160, 160))
q = im.quantize(colors=8, method=Image.MEDIANCUT)
pal = q.getpalette()
- counts = Counter(q.getdata())
+ data = q.get_flattened_data() if hasattr(q, "get_flattened_data") else q.getdata()
+ counts = Counter(data)
total = sum(counts.values())
ranked = counts.most_common()
tops = []
@@ -207,6 +208,35 @@ def raw_color_of(spec):
def build_title(city, color):
return f"{city}-{color} Cork Wallcovering | Phillipe Romano"
+# ---- Description (deterministic local template, $0 — texture line, no LLM needed) ----
+FAM_PHRASE = {
+ "White": "a bright, airy", "Neutral": "a warm, versatile", "Warm": "a golden, sun-warmed",
+ "Red": "a rich, earthy", "Green": "a soft, organic", "Blue": "a cool, coastal",
+ "Black": "a deep, dramatic", "Purple": "a moody, refined",
+}
+
+def build_description(city, color, fam, width, fire, backing):
+ tone = FAM_PHRASE.get(fam, "a natural")
+ w = (width or "").strip()
+ parts = [
+ f"The {city} colorway in {color} brings {tone} tone to our Phillipe Romano cork "
+ f"wallcovering — a 100% natural cork surface with the subtle, tactile grain that only "
+ f"real cork delivers.",
+ "Hand-crafted for interiors that want depth and warmth without pattern, cork adds quiet "
+ "texture to feature walls, studies, and hospitality spaces while softening sound.",
+ ]
+ specbits = []
+ if w:
+ specbits.append(f"{w} wide")
+ if backing:
+ specbits.append(f"{backing} backing")
+ if fire:
+ specbits.append(f"{fire} fire rating")
+ if specbits:
+ parts.append("Specifications: " + ", ".join(specbits) + ".")
+ parts.append("Sold per yard in 6-yard increments. Request a sample or a trade quote.")
+ return " ".join(parts)
+
def main():
out = []
missing_img = 0
@@ -227,6 +257,8 @@ def main():
mn, st = packaging(spec.get("minimum_order", ""))
title = build_title(city, color)
alt = f"{title} — {dwSku}"
+ desc = build_description(city, color, fam, spec.get("width", ""),
+ spec.get("fire_rating_us", ""), spec.get("backing", ""))
# tags >=2: material(Cork), color-family, city style, brand, quotes
tags = ["Cork", fam, city, "Phillipe Romano", "quotes"]
tags = [t for t in dict.fromkeys(tags) if t]
@@ -235,7 +267,7 @@ def main():
"material": "Cork", "city": city,
"rawColor": raw, "cleanColor": color, "colorSource": csrc,
"hex": dom_hex, "topColors": tops, "colorFamily": fam,
- "title": title, "alt": alt, "tags": tags,
+ "title": title, "alt": alt, "tags": tags, "description": desc,
"min": mn, "step": st, "minimumOrder": spec.get("minimum_order", ""),
"mfrSku": mfr, "mfrModel": mfr,
"collectionCode": series_of(mfr), "collectionName": spec.get("collection", ""),
@@ -261,6 +293,7 @@ def main():
"title_nonempty": sum(1 for x in out if x["title"]),
"alt_nonempty": sum(1 for x in out if x["alt"]),
"tags_ge2": sum(1 for x in out if len(x["tags"]) >= 2),
+ "description_nonempty": sum(1 for x in out if x.get("description")),
"missing_image": missing_img,
}
print(json.dumps({
← fc66c8b tag-updater: tags-only (drop colliding custom.* metafields)
·
back to Greenland Onboard
·
tag-updater: source from DB (authoritative hue/style), fixes e9e1bae →