Skip to main content

Google Auth with Python, but easy

The easiest way to authenticate for the Google services.

This library is intented to simplify the interaction with the Google API for using the Google services such as Youtube, Slides, etc.

Instructions

  1. Go to the Google Developers console: https://console.cloud.google.com.
  2. Go to the APIs library (https://console.cloud.google.com/apis/library) and enable the one you need.
  3. Go to the Oauth Credentials section (https://console.cloud.google.com/apis/credentials) and create a new Oauth Authentication ID for a Desktop App. Remember to download it as a JSON file when created. *Maybe you need to create a Consent screen (enable as testing and add yourself as a tester or publish it) and create a new project in the console.
  4. Place the client-secret.json in the project.
  5. Indicate that client-secret.json and use the library. You will generate a token.json that will be used to consider you as an authenticated user.

Usage

from google_auth_easy import GoogleAuth
from google_auth_easy.config import GoogleAuthConfig
from google_auth_easy.scopes import Scope

# Indicate your client_secret file
config = GoogleAuthConfig(
    client_secret_file = 'client_secret.json',
)

# Initialize the instance
auth = GoogleAuth(config)

# Authenticate it for your desired scopes
auth.authenticate(
    Scope.DRIVE_READONLY,
)

Extra information

client_secret.json

Your client secret information must be a .json file that includes your client id, your client secret and some other fields. You can download this information from Google API web platform by creating your Oauth user. Here is an example:

{
    "web": {
    "client_id": "XXXXXXX.apps.googleusercontent.com",
    "client_secret": "XXXXXX",
    "redirect_uris": [],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
    }
}

token.json

Your token must be a .json file that includes the information needed to authenticate your user, and some extra information such as if the token can be refreshed or not:

{
    "token": "ya29.a0ARGnu0ZyKzwSGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXwhXw0206",
    "refresh_token": "1//0g7tTXXXXXXXXXXXXXXXXXXXXXSNwF-L9Ir_hEj8XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7le_X6XXXXXXXXXXXQ",
    "token_uri": "https://oauth2.googleapis.com/token",
    "client_id": "59591XXXXXXXXXXXXXXXXXXXXXXXg1ti.apps.googleusercontent.com",
    "client_secret": "GXXXXXX-3gDXXXXXXXXXXXXXXXXXXXXXJP",
    "scopes": ["https://www.googleapis.com/auth/drive.readonly"],
    "universe_domain": "googleapis.com",
    "account": "",
    "expiry": "2026-08-05T12:37:57Z"
}

Metadata

Release files for google-auth-easy 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-auth-easy 0.0.6
File Size Uploaded
google_auth_easy-0.0.6.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for google-auth-easy 0.0.6
File Interpreter ABI Platform
google_auth_easy-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / google_auth_easy-0.0.6.tar.gz

Download URL google_auth_easy-0.0.6.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f05b5a566a0bd8fb250bbe71704fb3c804a695755991ee09cf4b55f16068f244
BLAKE2b-256 checksum
How to use checksums
155575410889757dc70df4f409c3575919279472ba5842c5dbb217e5003ed3fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.9.0 Windows/10

Release files / google_auth_easy-0.0.6-py3-none-any.whl

Download URL google_auth_easy-0.0.6-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b59310bb2d91648d4596aa6e676813fcb04171a20e89f3e81b92e05b271b29ec
BLAKE2b-256 checksum
How to use checksums
0b943472430caf637bbeec3ee727f6d0eed8f108092ba13d1d4623a0ed4be378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.9.0 Windows/10

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page