Trigger a function written in python


I would like to know, If I can a schedule a trigger or database trigger
if code is written in python in the external editor.

For example: I have written a code using python in vs code by making use of pymongo, that function does some job and now I would like to schedule it to run the program either by timely basis or if there is any change in database.
(there is a option in Atlas for trigger the function which supports node js, similarly would like to know
if can do the same for the function written in python).
Any help would be helpful.
Thank you