← back to Rentv Sheet Enrich

__pycache__/writeback.cpython-314.pyc

47 lines

+
$@j�
�	�Rt^RIt^RIt^RIt]PP^]PP
]PP]444^RI	t	R]P9tRtRt
Rt^RIt]!]P"!]!R444t]Uu.uFjqR,R8XgK]P)VR	,4'dK2]P+VR
,P-R4R%,4'dKhVNKl	upt]!R]44t]!R
]44t/t]FVt]!]R	,4P;4]!]R,4P;43t]P?]]R
,4KX	]	P@!4t!]	PD!]!]
4t#]#^,Uu.uFqPI4NK	upt%]&!]%4UUu/uFwr#V'gKW2bK	uppt'Rt(]'R	,]'R,ut)t*]'R,]'R,ut+t,]'P[R4t.].fL]/!]'Pa44^,t.]'d]	Pb!]!]R^R].RR/.4]2!R].24.t3^^^ut4t5t6]7!4t8]9!^]:!]#44F�t;]#];,t](!]])4](!]]*4ut<t=]<'gK)]<P;4]=P;43t]]9dKR](!]]+4'g2](!]],4'g#].]:!]48d!]!]].,4'd]5^,
t5K�]3P}R];R].R]],/4]8P]4]4^,
t4K�	]Uu.uF
qD]89gKVNK	upt@]2!R]:!]4R]R24]2!R]424]2!R]524]2!R]:!]@424]@R,'d*]2!R]@R,UUu.uFwrVVRV2NK	upp4]'g]2!R ]4R!24R#]9!^]:!]34^�4F!tA]	Pb!]!]]3]A]A^�,4K#	]2!R"]:!]34R#]
R$24R#uupiuupiuuppiuupiuuppi)&u
writeback.py — write the recovered emails into the LIVE RENTV sheet's
"Likely Email (inferred)" column. ADD-only, MX-valid-only (Option A).

Approved by Steve 2026-08-14 ("go approved" -> Option A).

Safety:
  * reads the LIVE tab (authoritative current state),
  * writes ONLY the "Likely Email (inferred)" column — NEVER the verified Email,
  * writes a row ONLY if all three email fields are still EMPTY (never overwrites),
  * Option A: skips any recovered email whose domain is not MX-valid,
  * matches each recovered email to its row by (Contact Name + Company/Venue),
  * --dry-run reports counts and writes NOTHING; --apply performs the batch_fill.

Uses the exact row0 convention infer_emails.py uses (row0 = index into the full
rows array, 0 = header row).
Nz--applyiW:zUnique Contacts (all tabs)c�6�T;'gRP4#)�)�strip)�ss&�writeback.py�normrs��Q�W�W�"�O�O�%�
%�zrentv_recovered_ALL.csv�	Domain MX�yes�Contact Name�Recovered Email�@c#�D"�TFqR,R8wgK^x�K	R#5i)r	r
N���.0�rs& r�	<genexpr>r$s���>�d���n��&=�1�1�d�s� �
 c#�"�TFtqR,R8XgK\P!VR,4'g<\P!VR,PR4R,4'gKp^x�Kv	R#5i)r	r
rrr
N�����)�guards�bad_name�blocked_domain�splitrs& rrr%s\���Y�t�!��~��'>�A�����>�):�;�;�"�1�1�!�4E�2F�2L�2L�S�2Q�RT�2U�V��A�t�s�A>�"A>�6A>�4
A>�Companyc�P�Ve"V\V48d\W,4#R#)Nr)�lenr)r�is&&r�gr3s ��1�=�Q��Q��Z�D���J�
H�b�
Hrz
Company/Venue�EmailzUpdated Email (found)zLikely Email (inferred)�row0�col0�valuez6note: 'Likely Email (inferred)' column created at col zOption A (MX-valid only): z recovered emails in scope (z low-confidence skipped)z#  rows to WRITE (empty + matched): z/  matched rows already had an email (skipped): z4  recovered emails with NO matching empty live row: :N�Nz   e.g.u;
DRY-RUN — nothing written. Re-run with --apply to write z cells.u
APPLIED — wrote z inferred emails to 'z' (green-flagged, ADD-only).r)B�__doc__�sys�os�csv�path�insert�dirname�abspath�__file__�lib�argv�APPLY�GID�TITLErr�list�
DictReader�open�_allrrr�recov�sum�skipped_nomx�
skipped_guard�wantr�lower�k�
setdefault�access_token�tok�read_tab�rowsr�H�	enumerate�cr�NAME�CO�EMAIL�UEM�get�INF�max�values�
batch_fill�print�cells�matched�already�nomatch�set�used�ranger�ri�nm�co�append�add�	unmatchedr)r�hr�vr<�nrXs0000000r�<module>r_sD���"��������2�7�7�?�?�2�7�7�?�?�8�#<�=�>�
��S�X�X���
��$��%�
��C�N�N�4� 9�:�;�<���	M�D�q�k�N�e�3������>�!2�3�
��&�&�q�):�';�'A�'A�#�'F�r�'J�K�
��D�	M���>�d�>�>���Y�t�Y�Y�
�
��	�A�	
�a���	 �	&�	&�	(�$�q��|�*<�*B�*B�*D�E�A��O�O�A�q�*�+�,�
�

�����
�|�|�C�����Q�� ��1�W�W�Y�� ����l�(�l�d�a�a�T�Q�T�l�(��H��^��a��0���b�
�w�Z��2�3�
��s��e�e�%�&���;�

�a�h�h�j�/�A�
�C�����s�C�6�1�f�c�7�D]�"^�!_�`�	�B�3�%�
H�I�	���q�!����'�
�u��
��3�t�9�
�B��R��A�
�q�$�Z��1�b��F�B��
��	����R�X�X�Z� �A���}����E�{�{�a��3�i�i�C�#�a�&�L�T�!�C�&�\�\��1����	�L�L�&�"�f�c�7�D��G�<�=��H�H�Q�K��q�L�G�� �.��1��
�Q�Q��.�	��"�3�u�:�,�.J�<�.�Xp�q�r��+�G�9�5�6��7��y�A�B��<�S��^�<L�M�N��R�=�=�	�)�y��}�=�}�e�a���1�R�D�k�}�=�>��	�H��	�QX�
Y�Z��1�c�%�j�#�
&�����s�C��q��3���0�'�	� ��U���,A�%��Hd�
e�f��	M�� !��(��>
/��>s<�Q-�1Q-�1Q-�Q-�;Q2�!Q7�2Q7�Q=�Q=�1R