Google API Python Client

The official Python client for Google's discovery-based APIs, covering hundreds of Google services from one package.

SDK
PyPI
v2.201.0
8,951 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 84
Maintenance 88
Community 92
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 85
Code Quality 78
Innovation 75
Learning Curve 70

Google API Python Client is the official Python library for calling Google’s discovery-based APIs — from Drive and Sheets to BigQuery and Cloud Storage — through a single unified interface. Instead of hand-writing HTTP requests for each service, developers call discovery.build() to get a dynamically generated client object whose methods mirror each API’s REST resources and methods.

Maintained by Google and used across countless automation scripts, backend services, and data pipelines, the library ships with cached discovery documents for fast, reliable client construction, plus built-in OAuth2/service-account authentication via google-auth. It is now in maintenance mode — Google recommends newer Cloud Client Libraries for greenfield projects — but remains the most complete way to reach less common or long-tail Google APIs from Python.

What You Get

  • A single pip install that can talk to hundreds of Google APIs (Drive, Sheets, Calendar, BigQuery, Cloud Storage, YouTube, and more)
  • Dynamically generated Resource objects via discovery.build(), with methods mirroring each API’s REST resources
  • Built-in OAuth2 and service-account authentication through google-auth and google-auth-httplib2
  • Batch HTTP requests, media upload/download helpers, and automatic retry/backoff via the http module
  • Locally cached discovery documents for fast, offline-friendly client construction

Common Use Cases

  • Automating Google Workspace tasks — reading/writing Sheets, managing Drive files, scheduling Calendar events
  • Building backend integrations with Google Cloud APIs not yet covered by a dedicated Cloud Client Library
  • Writing one-off scripts or ETL jobs that pull data from Google Analytics, YouTube, or Search Console
  • Prototyping against a new or less common Google API without waiting for a dedicated SDK

Under The Hood

Architecture — The library centers on discovery.build() in googleapiclient/discovery.py (1,669 lines), which loads a service’s JSON discovery document (from the bundled discovery_cache/documents cache or fetched live) and dynamically attaches methods to a Resource object that mirror the API’s declared resources/methods. Requests are serialized by model.py and executed by http.py (1,962 lines), which layers in batching (BatchHttpRequest), resumable media upload/download, and retry/backoff on top of httplib2. errors.py normalizes API error responses into typed exceptions. The design trades static, per-API code generation for one generic runtime engine that can reach any API describable by a discovery document.

Tech Stack — Pure Python (94% of the codebase), depending on httplib2 for transport, google-auth/google-auth-httplib2 for credentials, google-api-core for shared error/retry conventions, and uritemplate for URL templating. No async support — it’s a synchronous, httplib2-based client, which is dated relative to modern httpx/aiohttp-based SDKs but keeps the dependency surface small.

Code Quality — The tests/ directory covers discovery parsing, HTTP mocking, batch requests, and media handling, run via nox/unittest, though coverage is thinner than the 1,900+ line http.py module would ideally warrant. Code is well-commented with Apache-2.0 headers throughout, follows consistent naming, and error handling is centralized in errors.py rather than scattered inline.

API Design — The dynamic Resource object pattern is powerful (one client can reach any Google API) but sacrifices IDE autocomplete and static typing, since methods don’t exist until runtime — a real ergonomics cost compared to per-API Cloud Client Libraries. The README is explicit about this trade-off and points users toward the dedicated Cloud Client Libraries when one exists, which is an honest and helpful signal for newcomers deciding which library to reach for.

Used by 17 apps in this directory

HTML
45%
LGPL-2.1

Horilla

ERP · Human Resources

1,470

Open-source HRMS covering recruitment, attendance, payroll, and biometrics in one self-hosted Django application.

View details
91
Repo Health
60
Technical
64
Dependency
Built with
HTML 45%
Python 41%
JavaScript 11%
Updated 6 days ago
Python
71%
MIT

Langflow

AI Agents · AI Development

155,973

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
64
Dependency
Built with
Python 71%
TypeScript 21%
Updated 5 days ago
Python
66%
Other

Morphik

AI Development · Databases · Search

3,717

Morphik is an AI-native ingestion and retrieval engine that lets developers store, search, and reason over visually rich documents — scanned PDFs, manuals, slides, and video — without duct-taping together OCR, an embedding model, and a vector database.

View details
64
Repo Health
71
Technical
67
Dependency
Built with
Python 66%
TypeScript 23%
Updated 1 weeks ago
Python
38%
Other

Open WebUI

AI Agents · AI Assistants

156,607

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
92
Repo Health
75
Technical
66
Dependency
Built with
Python 38%
Svelte 35%
JavaScript 19%
Updated 5 days ago
TypeScript
92%
Other

OpenHands

AI Code Assistants · AI Development

91,695

The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.

View details
91
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 92%
Updated 6 days ago
Go
71%
Apache 2.0

OSV.dev

Security

3,001

Google's open-source vulnerability database that maps CVEs to exact package versions across 50+ ecosystems with a public API and data dumps.

View details
87
Repo Health
82
Technical
66
Dependency
Built with
Go 71%
Python 19%
Updated 6 days ago
Python
71%
Apache 2.0

SurfSense

AI Assistants · Search

16,586

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python 71%
TypeScript 27%
Updated 5 days ago
Python
68%
AGPL 3.0

Tracecat

AI Agents · Automation · Security

3,860

Open-source agentic security automation platform that runs AI agents and durable workflows at scale with sandboxed execution.

View details
89
Repo Health
88
Technical
66
Dependency
Built with
Python 68%
TypeScript 30%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers