google-oauth
OAuth2 for Google APIs
What it is and what it does
google-oauth is a Python library that handles OAuth2 authentication for Google service accounts, allowing server-to-server communication with Google APIs. It supports creating service account objects from JSON or PKCS12 credentials and provides methods to obtain and use OAuth2 access tokens. The library wraps the requests library to automatically attach proper Authorization headers to API calls.
The package implements only the service account (two-legged) OAuth2 flow, not the three-legged flow for web applications. It caches access tokens to avoid unnecessary token requests and provides a convenient shortcut method for making authenticated API calls. However, the package has been abandoned since its initial release in March 2016 and receives no maintenance, meaning it may not work with current Google API changes or modern Python security practices.
Use it for:
- Authenticate a backend service to call Google APIs (e.g., Google+ search, Gmail) without user interaction
- Automate Google API calls from a scheduled job or daemon using service account credentials
- Build a microservice that needs to access Google APIs with a fixed set of scopes and permissions
- Implement JWT-based authentication for Google service accounts in legacy Python 2/3 codebases
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements Google OAuth2 authentication for service accounts, enabling server-to-server API access using JSON or PKCS12 credentials.
No. The package is abandoned (last release 2016-03-28, no commits since 2016-08-06) and will not receive security updates or compatibility fixes. High install friction from pyOpenSSL dependencies and lack of support for modern Python versions make it a poor choice for new projects. Use the official google-auth library instead.
Install
google-oauth on PyPI
pip
pip install google-oauthuv
uv add google-oauthpoetry
poetry add google-oauthInstalling google-oauth
Before you install
High install friction due to pyOpenSSL build dependency requiring system-level OpenSSL headers (libssl-dev on Debian). Package is abandoned as of 2016-08-06 with no maintenance since initial release.
License in practice
MIT License permits commercial and private use with minimal restrictions, making it legally safe to adopt if you accept the maintenance risk.
Quickstart
pip install google-oauth
import json
from google_oauth import ServiceAccount
key = json.load(open('/path/to/credentials.json'))
auth = ServiceAccount.from_json(key=key, scopes=['https://www.googleapis.com/auth/plus.login'])
token = auth.access_token
Requires pyOpenSSL build dependencies; on Debian-based systems install libssl-dev. Package supports Python 2.7 or 3.3+.
Verify before relying
- Whether the package works with current Google OAuth2 API endpoints and security standards
- Compatibility with modern Python versions beyond 3.3+
- Whether access tokens are properly refreshed or if manual refresh is required
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,791 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 250,965/month — #8,607 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Keywords: google, oauth, oauth2, api, service, jwt
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
gcs-oauth2-boto-pluginProvides OAuth 2.0 authentication for Google…
permissive · top 15,000 on PyPI
pydata-google-authProvides helper functions to authenticate to…
permissive · top 1,000 on PyPI
google-auth-oauthlibIntegrates oauthlib with google-auth to handle…
permissive · top 1,000 on PyPI
google-oauth2-toolGenerates an OAuth2 key file from a Google…
permissive · top 15,000 on PyPI
google-authHandles server-to-server authentication with…
permissive · top 100 on PyPI
oauth2clientoauth2client is a deprecated OAuth 2.0 client…
permissive · top 1,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
oauth2Implements OAuth 1.0 authentication for Python…
permissive · top 15,000 on PyPI
cloudauthzCloudauthz obtains temporary credentials from…
permissive · top 15,000 on PyPI
django-google-ssoAdds Google OAuth 2.0 authentication to Django…
permissive · top 15,000 on PyPI