A lightweight Google Auth SDK for service accounts and OAuth2 login — clean, modern, and developer-focused.
pip install google-auth-lite
- ✅ Clean service account auth with
GoogleAuthLite
- ✅ OAuth2 login flow with
GoogleOAuthFlow
- ✅ Minimal dependencies, fast startup
- ✅ Flask example: OAuth login in under 60 seconds
- ✅ Dev-first: no config wizards, no Google UI bloat
from google_auth_rewired import GoogleAuthLite
auth = GoogleAuthLite("path/to/your-service-account.json", scopes=["https://www.googleapis.com/auth/drive"])
session = auth.authorized_session()
r = session.get("https://www.googleapis.com/drive/v3/files")
print(r.json())
from google_auth_rewired import GoogleOAuthFlow
flow = GoogleOAuthFlow(
client_id="your-client-id",
client_secret="your-client-secret",
scopes=["openid", "email", "profile"],
redirect_uri="http://localhost:5000/callback"
)
# Step 1: Get login URL
print(flow.auth_url())
# Step 2: Handle callback URL and get token
token = flow.fetch_token("http://localhost:5000/callback?code=...")
examples/oauth_web_flow.py
— Flask app with Google Loginexamples/drive_basic.py
— List files in Driveexamples/sheets_read.py
— Read Google Sheetsexamples/gmail_send.py
— Send email via Gmail APIexamples/gcs_upload.py
— Upload file to Google Cloud Storage
pytest tests/
Built with precision by cureprotocols
MIT — use freely, modify confidently, deploy globally.
---