1

I'm wondering if there is a way to deploy a Python script to Google App Engine which will download some data every day, and a parameters needs to be passed to the Python script from outside. It's not a HTTP service, so maybe though the Google API? Call Google API, invoke Python script mytest.py with parameter xxx.

Is this possible?

Thanks

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
FreshMike
  • 481
  • 1
  • 6
  • 26

2 Answers2

1

What your describing sounds like a Cloud Function, which would let you pass arbitrary parameters to a given Python script. You could pair this with Cloud Scheduler to call the function at a regular interval, however this would not allow you to modify the parameters passed to the function.

Depending on where the parameters are coming from, you could store them somewhere that the function could check once a day (such as in a database) or you could manually invoke the function every day.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
0

GAE isn't designed to run standalone scripts, it's designed for web apps. But depending on what your scripts are doing it may be possible to achieve the desired functionality with GAE by "packaging" your scripts as HTTP(S) handlers, see How to use Python main() function in GAE (Google App Engine)?.

If you choose to go this way then it shouldn't be very complicated to pass the desired arguments/parameters to these scripts via the URLs - the query strings for example.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97