← back to Fentucci
Filter fentucci.com catalog to natural materials only (358->91)
858e6ab0fbcb7104fc21d200f21d603af19ebba9 · 2026-06-24 10:51:10 -0700 · Steve
Files touched
M .gitignoreM scripts/refresh-catalog.py
Diff
commit 858e6ab0fbcb7104fc21d200f21d603af19ebba9
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Jun 24 10:51:10 2026 -0700
Filter fentucci.com catalog to natural materials only (358->91)
---
.gitignore | 1 +
scripts/refresh-catalog.py | 32 +++++++++++++++++++++++++++-----
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index 3979237..938927e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ tmp/
dist/
build/
.next/
+data/products.json
diff --git a/scripts/refresh-catalog.py b/scripts/refresh-catalog.py
index 7857a4d..058a30b 100644
--- a/scripts/refresh-catalog.py
+++ b/scripts/refresh-catalog.py
@@ -5,19 +5,41 @@ Run on Kamatera: python3 /root/Projects/Designer-Wallcoverings/DW-Websites/Fentu
"""
import subprocess, json, sys, os
+# Natural-materials filter (Steve 2026-06-24: "only show natural materials").
+# Allow-list on title: genuine natural-fiber substrates only (grasscloth, sisal,
+# linen, cork, raffia, silk, mica, stringcloth, etc.), with a hard exclude for
+# vinyl / faux / metallic / mural / printed-paper finishes. This deliberately
+# drops the ~267 vinyl/faux/metallic/printed-mural items and apparel leakage
+# (espadrilles, bomber jackets) so fentucci.com shows the natural line only.
+NATURAL_INCLUDE = (
+ r"grasscloth|sisal|jute|hemp|linen|silk|cork|raffia|abaca|seagrass|"
+ r"sea grass|arrowroot|paperweave|paper weave|paper-weave|mica|wool|"
+ r"bamboo|reed|rattan|hessian|burlap|stringcloth|string cloth|coir"
+)
+NATURAL_EXCLUDE = r"vinyl|faux|mural|mylar| suede|polyester|acrylic|non-woven|metallic"
+
SQL = """SELECT row_to_json(p) FROM (
SELECT id, title, vendor, handle, dw_sku, mfr_sku,
price::numeric as price, image_url, tags,
pattern_name, product_type
FROM shopify_products
WHERE vendor = 'Fentucci' AND status = 'ACTIVE'
+ AND lower(title) ~ '{inc}'
+ AND lower(title) !~ '{exc}'
ORDER BY title
-) p"""
+) p""".format(inc=NATURAL_INCLUDE, exc=NATURAL_EXCLUDE)
-result = subprocess.run(
- ['sudo', '-u', 'postgres', 'psql', '-d', 'dw_unified', '-t', '-A', '-c', SQL],
- capture_output=True, text=True
-)
+# Kamatera connects as postgres via sudo; Mac2's local dw_unified mirror takes
+# a plain psql. Try plain first (works on Mac2), fall back to sudo (Kamatera).
+def run_psql(argv_prefix):
+ return subprocess.run(
+ argv_prefix + ['psql', '-d', 'dw_unified', '-t', '-A', '-c', SQL],
+ capture_output=True, text=True
+ )
+
+result = run_psql([])
+if result.returncode != 0:
+ result = run_psql(['sudo', '-u', 'postgres'])
if result.returncode != 0:
print(f"[catalog] psql error: {result.stderr}", file=sys.stderr)
← 0697743 hero ghost-CTA legibility fix (white on dark renders) + css
·
back to Fentucci
·
Tighten fentucci.com to real natural materials only (drop 27 a54c39a →