← back to Jf Fabrics Recrawl
chore: lint + refactor write-enrichment (split imports, extract curl cmd), lint clean (session close)
83e7ae747f2fd485d0ab158f01a68cc9e8a8c72b · 2026-06-29 09:17:21 -0700 · steve@designerwallcoverings.com
Files touched
A dwjj-mfr-backfill/__pycache__/write-enrichment.cpython-314.pycM dwjj-mfr-backfill/write-enrichment.py
Diff
commit 83e7ae747f2fd485d0ab158f01a68cc9e8a8c72b
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date: Mon Jun 29 09:17:21 2026 -0700
chore: lint + refactor write-enrichment (split imports, extract curl cmd), lint clean (session close)
---
.../__pycache__/write-enrichment.cpython-314.pyc | Bin 0 -> 5401 bytes
dwjj-mfr-backfill/write-enrichment.py | 14 ++++++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dwjj-mfr-backfill/__pycache__/write-enrichment.cpython-314.pyc b/dwjj-mfr-backfill/__pycache__/write-enrichment.cpython-314.pyc
new file mode 100644
index 0000000..a527e09
Binary files /dev/null and b/dwjj-mfr-backfill/__pycache__/write-enrichment.cpython-314.pyc differ
diff --git a/dwjj-mfr-backfill/write-enrichment.py b/dwjj-mfr-backfill/write-enrichment.py
index b5527eb..bcc5527 100755
--- a/dwjj-mfr-backfill/write-enrichment.py
+++ b/dwjj-mfr-backfill/write-enrichment.py
@@ -2,7 +2,10 @@
"""Write JF enrichment specs (removability/paste/coverage/yards/origin/washable) onto the 58
DWJJ products as internal global.* metafields. DRY-RUN by default; --live to write; --test=N to limit.
Images deliberately excluded (sibling-colorway bleed risk)."""
-import json, subprocess, sys, os
+import json
+import os
+import subprocess
+import sys
DRY = '--live' not in sys.argv
TEST = next((int(a.split('=')[1]) for a in sys.argv if a.startswith('--test=')), None)
os.chdir(os.path.expanduser('~/Projects/Designer-Wallcoverings'))
@@ -11,7 +14,14 @@ DOMAIN = "designer-laboratory-sandbox.myshopify.com"
def gql(q, v=None):
body = {"query": q}
if v: body["variables"] = v
- p = subprocess.run(["curl","-s","-X","POST",f"https://{DOMAIN}/admin/api/2024-10/graphql.json","-H",f"X-Shopify-Access-Token: {TOKEN}","-H","Content-Type: application/json","-d",json.dumps(body)], capture_output=True, text=True)
+ cmd = [
+ "curl", "-s", "-X", "POST",
+ f"https://{DOMAIN}/admin/api/2024-10/graphql.json",
+ "-H", f"X-Shopify-Access-Token: {TOKEN}",
+ "-H", "Content-Type: application/json",
+ "-d", json.dumps(body),
+ ]
+ p = subprocess.run(cmd, capture_output=True, text=True)
return json.loads(p.stdout)
# staged record field -> Shopify global metafield key
FIELDS = {"removability":"Removability","paste":"Paste","coverage":"Coverage","yards_dr":"Yards Per Double Roll","origin":"Country of Origin","washable":"Washable"}
← 94a55b1 DWJJ: wrote JF enrichment specs (removability/paste/coverage
·
back to Jf Fabrics Recrawl
·
(newest)