[object Object]

← back to Rentv Sheet Enrich

master: split Marketing/VP into Name/Position/LinkedIn/Phone cols (441 parsed); apply_phones.py staged

27fa73a2e77c33825199ec445bd52816b749c2b8 · 2026-08-13 11:03:10 -0700 · Steve Abrams

Files touched

Diff

commit 27fa73a2e77c33825199ec445bd52816b749c2b8
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 13 11:03:10 2026 -0700

    master: split Marketing/VP into Name/Position/LinkedIn/Phone cols (441 parsed); apply_phones.py staged
---
 apply_phones.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/apply_phones.py b/apply_phones.py
new file mode 100644
index 0000000..a3bc435
--- /dev/null
+++ b/apply_phones.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+"""
+apply_phones.py — write scraped company phones into the master's "Company Phone (found)".
+Matches each row's Website (domain) to data/phones.json; fills only empty cells, greened.
+"""
+import lib, json, os
+GID = 3823360
+tok = lib.access_token()
+title = {s["properties"]["sheetId"]: s["properties"]["title"] for s in lib.get_meta(tok)["sheets"]}[GID]
+rows = lib.read_tab(tok, title); hdr = rows[0]
+def g(r,i): return (r[i] if i<len(r) else "").strip()
+wi = hdr.index("Website")
+pi = hdr.index("Company Phone (found)")
+phones = json.load(open(os.path.join(os.path.dirname(__file__),"data","phones.json")))
+cells = []
+for r in range(1, len(rows)):
+    dom = g(rows[r], wi)
+    ph = phones.get(dom)
+    if dom and ph and not g(rows[r], pi):
+        cells.append({"row0": r, "col0": pi, "value": ph})
+res = lib.batch_fill(tok, GID, cells)
+found = sum(1 for v in phones.values() if v)
+print(json.dumps({"domains": len(phones), "with_phone": found, "cells_written": res.get("totalUpdatedCells",0)}))

← 94e653b master enrichment: registered Unique Contacts tab, +websites  ·  back to Rentv Sheet Enrich  ·  master: 770 company phones from $0 website scrape written (1 7de7dbb →