← back to Rentv Sheet Enrich Refine

__pycache__/warmth.cpython-314.pyc

47 lines

+
��~j���R�RtRtR^(R^ R^R^R^RRRR/tR	tR
tRtRtR
tRtR#)u
Warmth scoring for RENTV leads — one definition of "warm", shared by the live
console (live_server.py) and the top-N export (export_top.py) so they never drift.

A lead's warmth blends the three signals that already live in the sheet:
  1. Centrality  — # Appearances (how many source tabs a contact shows up on).
  2. Intent      — Status (color): a flagged/left-message lead outranks a cold one.
  3. Reachability— do we actually have an email / phone / LinkedIn / enriched VP?
Plus a Strong-Prospects membership bonus (Steve's own hand-tagged short list).

The score is a plain int. Higher = work first. Section/header rows get a large
negative so they sink to the bottom under a descending sort.

Pure/stdlib, no deps — same input always yields the same score ($0, offline).
u🔥 WarmthzFlag / PriorityzIn Progress / Left MessagezProspect / Follow-upzActive / ContactedzNeeds Email / Outreach PendingzOn Hold / Inactive�Section / Categoryc��VPV4pVeV\V48�dR#W,pVfR#\V4P4#)N�)�get�len�str�strip)�row�idx�name�i�vs&&&  �	warmth.py�_cellrsA������
�A��y�A��S��M����A���2�.��A�����.�c��\\\V4P4;'g^44# \\
3d^#i;i)�)�int�floatrr�
ValueError�	TypeError)�ss&r�_intr's@����5��Q�����,�,�1�-�.�.���	�"����s�47�A�Ac��aa�^p\\SSR44pV\V^4^,,
p\SSR4pV\P	V^4,
p\SSR4P4pRV9d
V^,
p\SSR4;'g#\SSR4;'g\SSR4pV'd
V^
,
p\;QJd VV3RlR4F'gKR	M	R
M!VV3RlR44pV'd
V^,
p\SSR4'g\SSR4'd
V^,
p\SSR
4'g\SSR4'd
V^,
pV#)zNrow = list of cell values; idx = {header_name: col_index}. Returns int warmth.�
# Appearances�Status (color)�Source Tabs�strong prospects�Email�Updated Email (found)�Likely Email (inferred)c3�><"�TFp\SSV4x�K	R#5i�N�r��.0�pr
r	s& ��r�	<genexpr>�score.<locals>.<genexpr>Ds%����b�`�()��c�3��"�"�`���TF�Marketing/VP NamezMarketing/VP ContactzLinkedIn (Contact)zLinkedIn (Company)�zPhone 1zPhone 2zPhone 3zCompany Phone (found)zMarketing/VP Phone)rr�min�_STATUS_WEIGHTr�lower�any)r	r
�pts�appearances�status�src�email�phonesff      r�scorer6.sc���
�C��u�S�#��7�8�K��3�{�A���"�"�C��3��-�
.�F��>���f�a�(�(�C���S�-�
(�
.�
.�
0�C��S� ��r�	��
�#�s�G�$�
6�
6��c�3�8O�(P�
6�
6���c�4�5�
���r�	���C�b�`�b�C�C�C�b�`�b�
b�E���q����S�#�*�+�+�u�S�#�?U�/V�/V��q����S�#�+�,�,��c�3�@T�0U�0U��q����Jrc�Faa�.p\\SSR44pV'd TPTRV^8wdRMR24\SSR4pV'dVR8wdVPV4R\SSR4P49dVPR	4.p\SSR
4'g'\SSR4'g\SSR4'dVPR
4\;QJd VV3RlR4F'gKRM	RM!VV3RlR44'dVPR4\SSR4'dVPR4V'd(VPRRPV4,4RPV4#)uJShort human 'why warm' string for the export — mirrors score()'s inputs.rz tabrrrrrrzStrong Prospectrrr r4c3�><"�TFp\SSV4x�K	R#5ir"r#r$s& ��rr'�reason.<locals>.<genexpr>_s%����]�[�#$�5��c�1���[�r)TFr5r*z
VP contactzhas �/z; r+)rr�appendr.r/�join)r	r
�bits�appr2�reachsff    r�reasonr@PsQ���
�D�
�u�S�#��/�
0�C�
����s�e�4�s�a�x��R�8�9�:�
�3��-�
.�F�
�&�0�0����F���U�3��]�;�A�A�C�C����%�&��E��S�#�w���5��c�3J�#K�#K��S�#�8�9�9�
���W��
�s�]�[�]�s�s�s�]�[�]�]�]�
���W���S�#�*�+�+�
���\�"�����F�S�X�X�e�_�,�-��9�9�T�?�rc�<�\V4pRV9;'gRV9#)uKOnly augment tabs that actually carry the signals — others get no column.rr)�set)�headers�hss& r�	can_scorerEis#��	�W��B���"�>�>��2�(=�>rc��VPR.4p\V4'gV#\V4UUu/uFwr#W2bK		ppp\V4\.,p.pVPR.4F.pVP\V4\
Wt4.,4K0	\V4pWPR&W`R&\V4^,
VR&V#uuppi)u�Given a tab/combined payload {headers, rows, ...}, append the Warmth column
(in the RESPONSE only — never written back to the sheet). Returns the payload.rC�rows�
warmth_col)	rrE�	enumerate�list�
WARMTH_HEADERr;r6�dictr)�payloadrCr�hr
�new_headers�new_rows�rs&       r�augmentrRos����k�k�)�R�(�G��W�����%�g�.�
/�.�D�A�1�4�.�C�
/��w�-�=�/�1�K��H�
�[�[���
$������Q��5��=�/�1�2�%��7�m�G�$�I���F�O���,�q�0�G�L���N��0s�
CNi����i����)	�__doc__rKr-rrr6r@rErR�rr�<module>rUs\��� �
��r� �"��B��"�$�b��#��$���/���D�2?�r