[object Object]

← back to Title Fix

Title-fix Class A prep — constructed clean titles for the 46 no-name products (dry-run)

3477ba206fc1657694abda2bb8ee4bb9d7c3268e · 2026-08-02 00:40:21 -0700 · Steve Abrams

Files touched

Diff

commit 3477ba206fc1657694abda2bb8ee4bb9d7c3268e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun Aug 2 00:40:21 2026 -0700

    Title-fix Class A prep — constructed clean titles for the 46 no-name products (dry-run)
---
 data/restore-map-A.json |  18 ++++
 data/worklist-A.json    | 278 ++++++++++++++++++++++++++++++++++++++++++++++++
 fix_a.py                |  35 ++++++
 reverse_a.py            |  18 ++++
 4 files changed, 349 insertions(+)

diff --git a/data/restore-map-A.json b/data/restore-map-A.json
new file mode 100644
index 0000000..bb17517
--- /dev/null
+++ b/data/restore-map-A.json
@@ -0,0 +1,18 @@
+[
+{
+"num": "4746323591219",
+"old": "| DW Bespoke Studios"
+},
+{
+"num": "4746324574259",
+"old": "| DW Bespoke Studios"
+},
+{
+"num": "4746321166387",
+"old": "| DW Bespoke Studios"
+},
+{
+"num": "4469054177331",
+"old": "Patens blue-"
+}
+]
\ No newline at end of file
diff --git a/data/worklist-A.json b/data/worklist-A.json
new file mode 100644
index 0000000..c8f08e7
--- /dev/null
+++ b/data/worklist-A.json
@@ -0,0 +1,278 @@
+[
+{
+"num": "4746323591219",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42198 | DW Bespoke Studios"
+},
+{
+"num": "4746324574259",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42221 | DW Bespoke Studios"
+},
+{
+"num": "4746321166387",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42131 | DW Bespoke Studios"
+},
+{
+"num": "4469054177331",
+"vendor": "Mind the Gap",
+"old": "Patens blue-",
+"new": "Patens blue"
+},
+{
+"num": "4746322903091",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42178 | DW Bespoke Studios"
+},
+{
+"num": "7870251073587",
+"vendor": "Kravet",
+"old": ", Beige Wallcoverings | Kravet",
+"new": "Beige Wallcoverings | Kravet"
+},
+{
+"num": "7870251106355",
+"vendor": "Kravet",
+"old": ", Gray Wallcoverings | Kravet",
+"new": "Gray Wallcoverings | Kravet"
+},
+{
+"num": "7872081133619",
+"vendor": "Kravet",
+"old": ", Seafoam Green Wallcoverings | Kravet",
+"new": "Seafoam Green Wallcoverings | Kravet"
+},
+{
+"num": "7874488205363",
+"vendor": "Kravet",
+"old": ", Pale Beige Wallcoverings | Kravet",
+"new": "Pale Beige Wallcoverings | Kravet"
+},
+{
+"num": "7876091772979",
+"vendor": "Kravet",
+"old": ", Teal Wallcoverings | Kravet",
+"new": "Teal Wallcoverings | Kravet"
+},
+{
+"num": "7876091805747",
+"vendor": "Kravet",
+"old": ", Dark Blue Wallcoverings | Kravet",
+"new": "Dark Blue Wallcoverings | Kravet"
+},
+{
+"num": "7876091838515",
+"vendor": "Kravet",
+"old": ", Seafoam Green Wallcoverings | Kravet",
+"new": "Seafoam Green Wallcoverings | Kravet"
+},
+{
+"num": "7878350307379",
+"vendor": "Kravet",
+"old": ", Off-White Wallcoverings | Kravet",
+"new": "Off-White Wallcoverings | Kravet"
+},
+{
+"num": "7880406925363",
+"vendor": "Kravet",
+"old": ", Dark Teal Wallcoverings | Kravet",
+"new": "Dark Teal Wallcoverings | Kravet"
+},
+{
+"num": "7880479473715",
+"vendor": "Kravet",
+"old": ", Brown Wallcoverings | Kravet",
+"new": "Brown Wallcoverings | Kravet"
+},
+{
+"num": "4746432413747",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-27156 | DW Bespoke Studios"
+},
+{
+"num": "4746425532467",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-27363 | DW Bespoke Studios"
+},
+{
+"num": "4746431266867",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-27130 | DW Bespoke Studios"
+},
+{
+"num": "4746433200179",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-27175 | DW Bespoke Studios"
+},
+{
+"num": "1495167762544",
+"vendor": "Designer Wallcoverings",
+"old": "Hana Gold Leaf -",
+"new": "Hana Gold Leaf"
+},
+{
+"num": "4746323034163",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42182 | DW Bespoke Studios"
+},
+{
+"num": "4746328703027",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350100 | DW Bespoke Studios"
+},
+{
+"num": "4746329784371",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350129 | DW Bespoke Studios"
+},
+{
+"num": "4746270179379",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-17107 | DW Bespoke Studios"
+},
+{
+"num": "4746328834099",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350104 | DW Bespoke Studios"
+},
+{
+"num": "4746423959603",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-27326 | DW Bespoke Studios"
+},
+{
+"num": "4746423926835",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-27325 | DW Bespoke Studios"
+},
+{
+"num": "4746319298611",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42078 | DW Bespoke Studios"
+},
+{
+"num": "4746318708787",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42061 | DW Bespoke Studios"
+},
+{
+"num": "4746324148275",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42213 | DW Bespoke Studios"
+},
+{
+"num": "4746329292851",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350116 | DW Bespoke Studios"
+},
+{
+"num": "4746329653299",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350126 | DW Bespoke Studios"
+},
+{
+"num": "7871527485491",
+"vendor": "Kravet",
+"old": ", Light Beige Wallcoverings | Kravet",
+"new": "Light Beige Wallcoverings | Kravet"
+},
+{
+"num": "7875514794035",
+"vendor": "Kravet",
+"old": ", Olive Wallcoverings | Kravet",
+"new": "Olive Wallcoverings | Kravet"
+},
+{
+"num": "7876887117875",
+"vendor": "Kravet",
+"old": ", Gray Wallcoverings | Kravet",
+"new": "Gray Wallcoverings | Kravet"
+},
+{
+"num": "7880063778867",
+"vendor": "Kravet",
+"old": ", Navy Wallcoverings | Kravet",
+"new": "Navy Wallcoverings | Kravet"
+},
+{
+"num": "7880511258675",
+"vendor": "Kravet",
+"old": ", Dark Red Wallcoverings | Kravet",
+"new": "Dark Red Wallcoverings | Kravet"
+},
+{
+"num": "4746315923507",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-17115 | DW Bespoke Studios"
+},
+{
+"num": "4746319659059",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42089 | DW Bespoke Studios"
+},
+{
+"num": "4746319921203",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42096 | DW Bespoke Studios"
+},
+{
+"num": "4746329063475",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350109 | DW Bespoke Studios"
+},
+{
+"num": "4746329718835",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350127 | DW Bespoke Studios"
+},
+{
+"num": "4746329948211",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350133 | DW Bespoke Studios"
+},
+{
+"num": "4746329980979",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-4350134 | DW Bespoke Studios"
+},
+{
+"num": "4746321494067",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42141 | DW Bespoke Studios"
+},
+{
+"num": "4746323066931",
+"vendor": "Designer Wallcoverings",
+"old": "| DW Bespoke Studios",
+"new": "Vintage Wallpaper DIG-42183 | DW Bespoke Studios"
+}
+]
\ No newline at end of file
diff --git a/fix_a.py b/fix_a.py
new file mode 100644
index 0000000..a4b89c7
--- /dev/null
+++ b/fix_a.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+"""Title-fix Class A (46 no-real-name titles). PREP / DRY-RUN BY DEFAULT.
+NOTE: these have NO recoverable real pattern name (never captured; no external key). This applies
+CONSTRUCTED clean titles built from available data (Kravet=color, DW Bespoke=DIG-id [unique], MTG=strip):
+better than the current broken titles, but NOT the true original names. Steve's call to apply.
+DRY-RUN default; live = TITLEFIX_CONFIRM=YES python3 fix_a.py --apply [--canary N]. reverse_a.py undoes."""
+import os,sys,json,time,urllib.request,urllib.error
+HERE=os.path.dirname(os.path.abspath(__file__)); SHOP="designer-laboratory-sandbox.myshopify.com"; API="2024-10"
+def token():
+    for l in open(os.path.expanduser("~/Projects/secrets-manager/.env")):
+        if l.startswith("SHOPIFY_ADMIN_TOKEN="): return l.split("=",1)[1].strip()
+    sys.exit("no token")
+def main():
+    live="--apply" in sys.argv and os.environ.get("TITLEFIX_CONFIRM")=="YES"
+    if "--apply" in sys.argv and not live: print("REFUSING --apply without TITLEFIX_CONFIRM=YES. DRY-RUN.\n")
+    canary=int(sys.argv[sys.argv.index("--canary")+1]) if "--canary" in sys.argv else None
+    work=json.load(open(os.path.join(HERE,"data","worklist-A.json")))
+    if canary: work=work[:canary]
+    json.dump([{"num":w["num"],"old":w["old"]} for w in work],
+              open(os.path.join(HERE,"data","restore-map-A.json"),"w"),indent=0)
+    print(f"=== title-fix A [{'LIVE' if live else 'DRY-RUN'}] — {len(work)} CONSTRUCTED titles (not true names) ===\n")
+    tok=token() if live else None
+    done=err=0
+    for i,w in enumerate(work,1):
+        line=f"[{i}/{len(work)}] {w['num']} {w['vendor']}: {w['old']!r} -> {w['new']!r}"
+        if not live: print("WOULD:",line); continue
+        try:
+            req=urllib.request.Request(f"https://{SHOP}/admin/api/{API}/products/{w['num']}.json",
+                data=json.dumps({"product":{"id":int(w['num']),"title":w['new']}}).encode(),method="PUT",
+                headers={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"})
+            urllib.request.urlopen(req,timeout=40); done+=1; print("OK:",line)
+        except urllib.error.HTTPError as e: err+=1; print(f"FAIL {w['num']} HTTP {e.code}")
+        time.sleep(0.4)
+    print(f"\n{'applied=%d failed=%d'%(done,err) if live else 'DRY-RUN complete. Nothing written.'}")
+if __name__=="__main__": main()
diff --git a/reverse_a.py b/reverse_a.py
new file mode 100644
index 0000000..e734544
--- /dev/null
+++ b/reverse_a.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+"""Reverse title-fix A: restore old titles from data/restore-map-A.json. DRY-RUN default; live needs --apply + TITLEFIX_CONFIRM=YES."""
+import os,sys,json,time,urllib.request,urllib.error
+HERE=os.path.dirname(os.path.abspath(__file__)); SHOP="designer-laboratory-sandbox.myshopify.com"; API="2024-10"
+def token():
+    for l in open(os.path.expanduser("~/Projects/secrets-manager/.env")):
+        if l.startswith("SHOPIFY_ADMIN_TOKEN="): return l.split("=",1)[1].strip()
+    sys.exit("no token")
+live="--apply" in sys.argv and os.environ.get("TITLEFIX_CONFIRM")=="YES"
+rows=json.load(open(os.path.join(HERE,"data","restore-map-A.json")))
+print(f"=== reverse title-fix [{'LIVE' if live else 'DRY-RUN'}] — {len(rows)} ===")
+tok=token() if live else None
+for r in rows:
+    if not live: print(f"WOULD restore {r['num']} -> {r['old']!r}"); continue
+    req=urllib.request.Request(f"https://{SHOP}/admin/api/{API}/products/{r['num']}.json",
+        data=json.dumps({"product":{"id":int(r['num']),"title":r['old']}}).encode(),method="PUT",
+        headers={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"})
+    urllib.request.urlopen(req,timeout=40); print(f"OK: {r['num']}"); time.sleep(0.4)

← d87a44f Title-fix prep — dry-run tooling for 999 double-bar titles;  ·  back to Title Fix  ·  Refine Class-A constructed titles (No.-format for Bespoke, s fdb0f12 →