← back to Rentv Sheet Enrich

__pycache__/infer_emails.cpython-314.pyc

59 lines

+
�Mj���Rt^RIt^RIt^RItRt0RmtRtRtRRRRR	R
RRR
RRRRRRRRRRR/
tRt	Rt
]R8Xd
]
!4R#R#)uo
infer_emails.py — GENERATIVE email inference (Steve 2026-08-13). For each named contact
missing a real email, generate the LIKELY email by LEARNING that company's actual naming
convention from its known emails (e.g. if 'blake.thompson@nmrk.com' exists, Newmark uses
first.last -> infer 'jane.doe@nmrk.com'). Falls back to first.last@domain when a company
has a domain but no detectable pattern. Written to a clearly-labeled "Likely Email
(inferred)" column, GREEN + flagged — never the real Email column, so guesses are never
mistaken for verified. ADD-only; skips contacts that already have a real or inferred email.
NiW:c�b�\P!RRT;'gRP44#)z[^a-z]�)�re�sub�lower)�ss&�infer_emails.py�alphar	s!��R�V�V�I�r�A�G�G��?�?�+<�=�=�c�t�\P!RVP44Uu.uF-q'gKV^,P4'gK+VNK/	ppV'gR#\	V^,4p\V4^8�d\	VR,4MRpT;'gRT;'gR3#uupi)z[\s,]+Nr)NN�����)r�split�strip�isalphar	�len)�name�t�toks�first�lasts&    r�partsrs����x�x�	�4�:�:�<�8�Q�8�!�A�A�!�A�$�,�,�.�A�A�8�D�Q��
�"��$�q�'�N�E�c�$�i�!�m�5��b��?��D��=�=�D�$�,�,�$�&�&��Rs�	B5�B5�B5z
first.lastc��VRV2#��.���f�ls&&r�<lambda>r���!��A�a�S�zr
�	firstlastc��VV2#�Nrrs&&rrrs��!��Q�C�yr
�flastc��V^,V2#��rrs&&rrrs��!�A�$���s�|r
zf.lastc��V^,RV2#)r&rrrs&&rrrs��!�A�$��q���}r
�
first_lastc��VRV2#)�_rrs&&rrrrr
�firstlc��VV^,2#r%rrs&&rrr���!��Q�q�T�F�|r
�lastfc��VV^,2#r%rrs&&rrrr-r
z
last.firstc��VRV2#rrrs&&rrrrr
rc��V#r"rrs&&rrr ���qr
rc��V#r"rrs&&rrr!r2r
c��\V4p.pV'gV#\P4FJwrEV'gVR9d6\T!Y;'gT44V8XdVPV4KHKJKL	V# \dK^i;i)z8Which template(s) produce this local-part for this name.)r)r	�	TEMPLATES�items�append�	Exception)rr�local�outr�fns&&&   r�detectr<#s����%�L�E��#���*��O�O�%���	���
�*��b��
�
��6N�0O�SX�0X��
�
�4� �1Y�*�&��J���	��	�s�A<�!A<�<B�
Bc
��\P!4pRp\P!W4q"^,Uu.uFq3P4NK	pp\	V4UUu/uFwrVV'gKWebK	pppRpVR,q�R,q�R,q�R,pVPR4p
V
fD\
VP44^,p
\P!V\R^R	V
R
R/.4/p/pVR,EFpV!VV
4P4pV!VV4P4pV!VV	4p\P!RV4pV'd	V'gKdVP^4VP^4P4ppV\9dK�VPVV4\!V4wpp\#VVV4FApVPV/4PV^4VV,V;;,^,
uu&KC	EK	VP%4UUu/uF*wppV\
VP%4R
R7^,bK,	ppp.p^p^p\	VR,^R7EF;wppV!VV	4pV'dV^,P'4'gK7V!VV
4'gV!VV4'gV!VV
4'dKfV!VV4P4pVPV4pV'gK�\!V4wppV'd	V'gK�VV9d/\)\*VV,,!VV44pV^,
pMVRV2pV^,
pVRV2p\,P.!VV4'gEK$VP1RVR	V
R
V/4EK>	\P!V\V4\3R\5V424\3R\5V4RVRVR24VR,F-p \3RV!VV R,,V	4RV R
,4K/	R#uupiuuppiuuppi)zUnique Contacts (all tabs)c�v�Ve'V\V48dW,P4#RP4#)Nr)rr)�r�is&&r�g�main.<locals>.g4s.����1�s�1�v�:���L�L�N�N�2�L�L�N�Nr
zContact Name�Emailz
Company/VenuezUpdated Email (found)zLikely Email (inferred)N�row0�col0�value:�NNz([^@\s]+)@([\w.-]+)c��V^,#)rGr)�xs&rr�main.<locals>.<lambda>Js��A�a�Dr
)�key)�startr�@z)companies with a detected email pattern: zinferred emails written: z  (z from company pattern, z from first.last default):N�Nz   z->)�lib�access_token�read_tabr�	enumerate�get�max�values�
batch_fill�GIDrr�search�group�FREE�
setdefaultrr<r6rr	r5�guards�ok_emailr7�printr)!�tok�title�rows�h�hdr�j�v�crA�NAME�EMAIL�CO�UEM�INF�dom�votesr?�e�co�nm�mr9�drrr�pat�cells�n_pat�	n_default�ri�email�cells!                                 r�mainrz/s���

�
�
�
�C�(�E��<�<��#�D�A�w�+G�w�!�G�G�I�w�S�+G�#�C�.�.�.�$�!�A����.�A�.�N��^��D��j�e��7I�"�Sj�Qk�3�
�%�%�)�
*�C�
�{��!�(�(�*�o��!�����s�C�6�1�f�c�7�D]�"^�!_�`�
�C�b�e�
�"�X�X��
�a��K�����a��2�h�n�n�&6��Q�q�$�Z���I�I�,�a�0����H��7�7�1�:�q�w�w�q�z�/�/�1�q����9�h����r�1���R�y���1���1�e�$�A����R��$�/�/��1�5��"�I�a�L�A��L�%��CH�+�+�-�
P�-���Q�2�s�1�7�7�9�.�1�!�4�4�-�C�
P�
�E���q�9��4��8�1�-�-���A�
�q�$�Z����A������(��Q��;�;�!�A�s�)�)�q��C�y�y�(�
�q�"�X�^�^�
��3�7�7�2�;�q��(��R�y���1���8�
��9��)�C��G�,�Q��2�3�E�U�a�Z�U��c��1�#�J�E�	�Q��	��'��1�#������r�5�)�)��
���f�b�&�#�w��>�?�.� �N�N�3��U�#�	�5�c�#�h�Z�
@�A�	�%�c�%�j�\��U�G�;R�S\�R]�]v�
w�x��b�	�	��
�e�Q�t�D��L�)�4�0�$��W�
�F���a,H��.��.Qs�Q� Q
�1Q
�.0Q�__main__>�me.com�aol.com�att.net�mac.com�msn.com�live.com�	gmail.com�	yahoo.com�	ymail.com�
icloud.com�comcast.net�hotmail.com�outlook.com�
sbcglobal.net)�__doc__rOrr\rWrZr	rr5r<rz�__name__rr
r�<module>r�s������
��\��=�'��)��(��+��,��)��+��+��)��=�
�=�
�	�
�4G�l�z���F�r