These steps are taken via a web browser while logged in to your Google user account.

This is probably the trickiest part. It's really just a matter of going to your Google account to enable features and create credentials, which you will then use in your Python program to access your Google Docs. But the specific details, like the user interface, menu locations, specific names for things, etc. seem to always be changing. So getting through this part can be a bit of a slog.

But here we go...

Create a New Project

Follow these steps to create a new project.

  • From your Google API Dashboard, click CREATE
  • NOTE: If you have already existing projects, this screen will look different.
  • Give the project a name, like Sheets API
  • You can leave Organization and Location blank or with default values
  • Click CREATE
  • You should be returned to the main Dashboard screen and your new project is selected.

Enable APIs for the Project

Follow these steps to add the needed APIs to the Project.

  • From the Dashboard screen, click ENABLE APIS AND SERVICES
  • In the Search box, enter "drive"
  • After entering "drive" in the Search box, select Google Drive API from the list.
  • On the next screen, click ENABLE.
  • Now search for "sheets" and select Google Sheets API
  • On the next screen, click ENABLE.
  • Back at the main Dashboard, verify that the two APIs have been added.

Create a Service Account

Follow these steps to create the credentials needed to access your Sheet from Python.

  • Click on the 3 bars to access the menu and go to IAM & admin -> Service accounts
  • On the Service Accounts screen, click CREATE SERVICE ACCOUNT.
  • Give the service account a name like google-sheets-api and click CREATE.
  • Click CONTINUE on the next screen.
  • On the final screen, click CREATE KEY.
  • Make sure JSON is selected and click CREATE.
  • You will be prompted to save a .json file. Save this somewhere safe.
The .json file you download contains secret information. Be sure to keep it safe and don't share the contents with anyone. Be careful to not post the credentials on GitHub or similar sites.

Everything should now be enabled and set up.

If you have created and saved the .json file successfully, then move on to the next step.

This guide was first published on Jan 17, 2020. It was last updated on Mar 28, 2024.

This page (Google Setup) was last updated on Mar 08, 2024.

Text editor powered by tinymce.