Best answer

PYTHON | runtime parameter python3.7 is no longer supported

  • 13 February 2024
  • 3 replies
  • 248 views

Userlevel 1

Getting error “The runtime parameter of python3.7 is no longer supported use the new runtime (python3.12)”

Code follows;
 

import re

def extract_info(text):
info_dict = {
'Realtor Full Name': 'UNKNOWN',
'Realtor First Name': 'UNKNOWN',
'Realtor Last Name': 'UNKNOWN',
'Realtor Phone': None,
'Realtor Email': None,
'Client Full Name': 'UNKNOWN',
'Client First Name': 'UNKNOWN',
'Client Last Name': 'UNKNOWN',
'Client Phone': None,
'Client Email': None,
}

client_pattern = re.compile(r"Client Name: (\w+)(?: (\w+))?\nClient Phone: (.*?)\nClient Email: (\S+)?")
realtor_pattern = re.compile(r"Realtor Name: (\w+)(?: (\w+))?\nRealtor Phone: (.*?)\nRealtor Email: (\S+)?")

client_match = client_pattern.search(text)
if client_match:
first_name, last_name, phone, email = client_match.groups()
info_dict['Client First Name'] = first_name
info_dict['Client Last Name'] = last_name if last_name else 'UNKNOWN'
info_dict['Client Full Name'] = f"{first_name} {last_name if last_name else 'UNKNOWN'}"
info_dict['Client Phone'] = phone.strip() if phone else None
info_dict['Client Email'] = email if email else None

realtor_match = realtor_pattern.search(text)
if realtor_match:
first_name, last_name, phone, email = realtor_match.groups()
info_dict['Realtor First Name'] = first_name
info_dict['Realtor Last Name'] = last_name if last_name else 'UNKNOWN'
info_dict['Realtor Full Name'] = f"{first_name} {last_name if last_name else 'UNKNOWN'}"
info_dict['Realtor Phone'] = phone.strip() if phone else None
info_dict['Realtor Email'] = email if email else None

return info_dict

email_content = inputData['body_plain']
info = extract_info(email_content)

output = {'output': info}

 

icon

Best answer by Mr Anomalous 13 February 2024, 18:41

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @Mr Anomalous 

You may want to try opening a ticket with Zapier Support about this: https://zapier.com/app/get-help

Userlevel 1

Hi @Mr Anomalous 

You may want to try opening a ticket with Zapier Support about this: https://zapier.com/app/get-help

Great idea, thank you! Just submitted a ticket. 🙂

Userlevel 1

Hi there, 
 
Cat here from Zapier - thanks for reaching out about the error message in Python Code by Zapier steps about the Python version being deprecated. This error appeared when creating and testing steps using the Python Code by Zapier action and in Zap runs for Zaps using Python code steps. 
 
Our team identified the issue, updated the Python version in use, and was able to replay any Zap runs that experienced an error. You do not need to make any further updates to your Zaps. 
 
Thanks for your patience and understanding. Please don't hesitate to contact us if any further issues remain.
 
Best,

--
Cat M. - Zapier Support

 

All set!