Python 3.9 is now generally available.

google.appengine.api.app_identity.get_application_id

Gets the application ID of an app.

Not to be confused with google.appengine.api.full_app_id.get(), which gets the "raw" app ID.

The application ID of the app.