you could also use the google apps script execution api https://developers.google.com/apps-script/execution/rest/v1/scripts it has examples for connecting it to python
You could also use the Google Apps script execution API.
It has examples for connecting it to Python.