[object Object]

← back to Rentv Sheet Enrich Refine

Layer 1 LIVE: websites + 4 new cols (Website/LinkedIn Co/LinkedIn Contact/Marketing-VP) filled green across 3 revenue tabs

366134498c7a8fc65443cd64bd06b54f1eae2c9e · 2026-08-13 09:24:14 -0700 · Steve Abrams

Files touched

Diff

commit 366134498c7a8fc65443cd64bd06b54f1eae2c9e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 13 09:24:14 2026 -0700

    Layer 1 LIVE: websites + 4 new cols (Website/LinkedIn Co/LinkedIn Contact/Marketing-VP) filled green across 3 revenue tabs
---
 __pycache__/lib.cpython-314.pyc | Bin 6024 -> 6414 bytes
 enrich.py                       |  20 ++++++++++++++------
 lib.py                          |  17 +++++++++++------
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/__pycache__/lib.cpython-314.pyc b/__pycache__/lib.cpython-314.pyc
index 4319f88..a5b414e 100644
Binary files a/__pycache__/lib.cpython-314.pyc and b/__pycache__/lib.cpython-314.pyc differ
diff --git a/enrich.py b/enrich.py
index ae83374..9199d38 100644
--- a/enrich.py
+++ b/enrich.py
@@ -31,15 +31,18 @@ FREEMAIL = {"gmail.com","hotmail.com","yahoo.com","outlook.com","aol.com","iclou
 TABS = {
     1536880271: dict(name="Sponsor & Speaker Companies",
         header_row=0, data_start=2, company=2, email=6,
-        new_website=10, new_linkedin=11, new_mvp=12),
+        new_website=10, new_li_company=11, new_li_contact=12, new_mvp=13),
     2087021739: dict(name="Strong Prospects",
         header_row=0, data_start=1, company=3, email=7,
-        new_website=9, new_linkedin=10, new_mvp=11),
+        new_website=9, new_li_company=10, new_li_contact=11, new_mvp=12),
     1929460437: dict(name="Event Sponsors",
         header_row=0, data_start=1, company=2, email=6,
-        new_website=8, new_linkedin=9, new_mvp=10),
+        new_website=8, new_li_company=9, new_li_contact=10, new_mvp=11),
 }
 
+NEW_COLS = [("new_website","Website"), ("new_li_company","LinkedIn (Company)"),
+            ("new_li_contact","LinkedIn (Contact)"), ("new_mvp","Marketing/VP Contact")]
+
 def cell(row, i):
     return row[i].strip() if i < len(row) else ""
 
@@ -58,8 +61,8 @@ def plan_tab(gid, rows):
     # header cells for the new columns (only if currently blank)
     hr = cfg["header_row"]
     hdr = rows[hr] if hr < len(rows) else []
-    for col, label in [(cfg["new_website"],"Website"),(cfg["new_linkedin"],"LinkedIn"),
-                       (cfg["new_mvp"],"Marketing/VP Contact")]:
+    for key, label in NEW_COLS:
+        col = cfg[key]
         if cell(hdr, col) == "":
             fills.append({"row0": hr, "col0": col, "value": label})
     for r in range(cfg["data_start"], len(rows)):
@@ -96,13 +99,18 @@ def main():
         for s in meta["sheets"]:
             title_by_gid[s["properties"]["sheetId"]] = s["properties"]["title"]
 
+    only = None
+    if "--only" in sys.argv:
+        only = int(sys.argv[sys.argv.index("--only")+1])
     for gid, cfg in TABS.items():
+        if only is not None and gid != only:
+            continue
         if mode == "--apply":
             rows = lib.read_tab(tok, title_by_gid[gid])
         else:
             rows = load_csv(gid)
         fills, stats = plan_tab(gid, rows)
-        data_fills = [f for f in fills if f["value"] not in ("Website","LinkedIn","Marketing/VP Contact")]
+        data_fills = [f for f in fills if f["row0"] != cfg["header_row"]]
         print(f"\n=== {cfg['name']} (gid={gid}) ===")
         print(f"  companies: {stats['rows']} | website derivable now: {stats['website_fill']}"
               f" | freemail-only (Layer2): {stats['freemail_only']} | no-email (Layer2): {stats['no_email']}")
diff --git a/lib.py b/lib.py
index e12be3f..9f5495d 100644
--- a/lib.py
+++ b/lib.py
@@ -70,14 +70,19 @@ def batch_fill(tok, sheet_id, cells):
     cells: list of dicts {row0, col0, value}  (0-based row/col indices)
     Writes each value AND stamps a light-green background, in ONE batchUpdate.
     """
-    reqs = []
-    for c in cells:
-        reqs.append({"updateCells": {
+    def mk(c):
+        return {"updateCells": {
             "start": {"sheetId": sheet_id, "rowIndex": c["row0"], "columnIndex": c["col0"]},
             "rows": [{"values": [{
                 "userEnteredValue": {"stringValue": str(c["value"])},
                 "userEnteredFormat": {"backgroundColor": GREEN}}]}],
-            "fields": "userEnteredValue,userEnteredFormat.backgroundColor"}})
-    if not reqs:
+            "fields": "userEnteredValue,userEnteredFormat.backgroundColor"}}
+    if not cells:
         return {"skipped": True}
-    return _req("POST", f"{API}/{SID}:batchUpdate", tok, {"requests": reqs})
+    total = 0
+    CHUNK = 400
+    for i in range(0, len(cells), CHUNK):
+        reqs = [mk(c) for c in cells[i:i+CHUNK]]
+        res = _req("POST", f"{API}/{SID}:batchUpdate", tok, {"requests": reqs})
+        total += len(reqs)
+    return {"totalUpdatedCells": total}

← f280a73 enrich Layer 1: website-from-email-domain engine + dry-run (  ·  back to Rentv Sheet Enrich Refine  ·  Layer 1 complete: collision-proof column placement (live-det 9d158db →