← back to Rentv Sheet Enrich Refine

sample_layer2.py

38 lines

import sys, os
sys.path.insert(0, os.path.dirname(__file__))
import lib
GID = 1536880271           # Sponsors
L_CO, L_CONTACT, MVP = 11, 12, 13
LI = "https://www.linkedin.com"
# (row1based, company_slug, contact_slug, marketing_vp_text)  — verified via Exa, honest blanks where none
DATA = [
 (4,  "1784-holdings-llc", "shanecalbers1", "Terri Guske — EVP Operations — %s/in/terri-guske-b6150813"%LI),
 (5,  "1st-service-solutions-inc.", "ann-hambly-castle-cre-9ba4432", "Stephanie Whittington — SVP Operations — %s/in/stephanie-whittington-a7b80889"%LI),
 (6,  "20-20-foresight", "", "Wende Ascher — SVP Marketing & Operations — %s/in/wendeascher"%LI),
 (7,  "29th-street-capital", "", "Sharie Rocker Damm — Dir. Corporate Comms & PR — %s/in/sharie-rocker-damm-7999a38"%LI),
 (11, "9thstpartners", "tomashcraft", "Richard Pinckert — VP Operations — %s/in/richardpinckert"%LI),
 (13, "abc-supply", "", "Rich Thompson — VP of Marketing — %s/in/rich-thompson-7319307"%LI),
 (14, "abi-multifamily", "", "Brad Pickering — Senior VP — %s/in/bradpickering"%LI),
 (15, "able-services", "", "Harold Hacker — Vice President — %s/in/harold-hacker-928650bb"%LI),
 (17, "", "adjcommercial", ""),
 (18, "adler-realty-investments", "mandana-towfiq-tarr-b9184b8", "Michael Adler — President/CEO — %s/in/michael-adler-3b29867"%LI),
 (19, "admiralcg", "drobinsonjr", ""),
 (20, "advanced-real-estate-services", "paul-julian-0a8467310", ""),
]
tok = lib.access_token()
cells = []
for row1, co, contact, mvp in DATA:
    r0 = row1 - 1
    if co:
        cells.append({"row0": r0, "col0": L_CO,
            "value": '=HYPERLINK("%s/company/%s")' % (LI, co), "formula": True})
    if contact:
        cells.append({"row0": r0, "col0": L_CONTACT,
            "value": '=HYPERLINK("%s/in/%s")' % (LI, contact), "formula": True})
    if mvp:
        cells.append({"row0": r0, "col0": MVP, "value": mvp})
res = lib.batch_fill(tok, GID, cells)
print("Wrote", res.get("totalUpdatedCells"), "Layer-2 sample cells (light-green).")
print("Companies:", len(DATA), "| with company LI:", sum(1 for d in DATA if d[1]),
      "| contact LI:", sum(1 for d in DATA if d[2]), "| marketing/VP:", sum(1 for d in DATA if d[3]))