vperezb / google-api-support

GAS · Some functions to make Google APIs more accesible - Python
https://pypi.org/project/google-api-support/
The Unlicense
17 stars 8 forks source link

google-api-support

Some functions to make Google APIs more usable.

Install

pip install google-api-support

Contribute

The contributions are encouraged so the library can keep growing and help more people.

You can also create an issue in order to point other contributors to desired functionalities.

Functions avaliable

Steps to use google Sheets API

In order to use Google APIs you will need to authenticate, this steps guide you through the process:

  1. Create a project in console.developers.google.com

https://console.developers.google.com

  1. Create google service account.

    1. Go to https://console.developers.google.com/projectselector/apis/credentials and create a new project. Create a developers project

    2. Create credentials.

      • In this first version, i will explain how to deal with Services accounts, so select "Service account key".
    3. Create a service account.

      • Download the .json file and KEEP IT SAFE.
    4. Now you have your service account created inside your new project.

    5. Copy your "user id" in "Manage service accounts" to use it later.

      • It looks like this one: first-service-account@example-id-175820.iam.gserviceaccount.com
    6. Go to your dashboard screen and go to "ENABLE APIS AND SERVICES" to "unlock" the desired API calls. In our example, we will just enable "Google sheets API".

Check the specific credentials documentation file

Credentials documentation

Manually install dependencies

pip install httplib2 oauth2client pandas google-api-python-client google.auth.transport.requests google.oauth2.credentials google_auth_oauthlib.flow

Complete first use example

Example using virtualenv in bash terminal

virtualenv venv pip install google-api-support pip install jupyterlab source venv/Scripts/activate export GOOGLE_APPLICATION_CREDENTIALS=C:/path/to/my/service_account_credentials.json jupyter lab

Setup to developement

virtualenv venv pip install . pip install jupyterlab source venv/Scripts/activate export GOOGLE_APPLICATION_CREDENTIALS=C:/path/to/my/service_account_credentials.json jupyter lab