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
- Go to the Google Developers console: https://console.cloud.google.com.
- Go to the APIs library (https://console.cloud.google.com/apis/library) and enable the one you need.
- 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. - Place the
client-secret.jsonin the project. - Indicate that
client-secret.jsonand use the library. You will generate atoken.jsonthat 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| google_auth_easy-0.0.6.tar.gz | 5.5 kB | Without provenance | Details for google_auth_easy-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| google_auth_easy-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for google_auth_easy-0.0.6-py3-none-any.whl |
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
|
Security for google-auth-easy 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.