How can I import Python modules inside SCRIPT QUERY?

Hi, I’m trying to use “SCRIPT QUERY” to get data from external sources, however I made my functions in my frappe apps. I can’t find the way to import my function from my frappe apps to my Script Query. For example, my functions locate at myapp.myapp.apis.utils…

Basically, I just want to know how to import Python modules inside SCRIPT QUERY, that’s all.

Does anyone have the way to do that?

from yourapp.module.doctype.doctype_name.doctype_name import send_notification

You cannot write import statements in script query

However, you can use frappe.call to call any whitelisted methods in your app

Refer: Frappe Ajax Call