r/pythonhelp • • Mar 12 '22

Accessing Python Gmail API in a local app that isn't tied to a Google Cloud Platform project?

I'd like to write a small Python app that I can run locally to perform some maintenance on my Gmail account (specifically, managing filters). I understand that the Gmail API is very capable and can provide these functions via a convenient RESTful API.

I've looked at about a dozen Gmail API tutorials, and all of them start like this:

"Login to your Google Cloud Platform account, create a project, and authorize it to use the API..."

Or:

"Login to your Google Cloud Platform account, access Credentials, and create some OAuth 2.0 credentials for your GCP project..."

And Google's own page for creating API keys goes like this:

To create your application's API key:

  • Go to the API Console.

  • From the projects list, select a project or create a new one.

  • Choose Credentials. Click Create credentials and then select API key.

But I don't have or want to run my code inside a GCP project. All I want to do is to grant my locally-running Python app some credentials so that I can make RESTful API calls. I don't understand why all of these tutorials require anything associated with a GCP project.

Has anyone else encountered this issue? Is it even possible to access the Gmail API outside of a GCP project?

Thanks in advance.

4 Upvotes

0 comments sorted by