PyDrive2
Google Drive API made easy. Maintained fork of PyDrive.
What it is and what it does
PyDrive2 is a maintained fork of the original PyDrive, built to simplify working with Google Drive through Python. It wraps google-api-python-client into higher-level classes representing Drive resources (files, folders) and handles OAuth2 authentication in just a few lines of code. Instead of writing raw API calls, you work with objects—create files, set content, upload, download, and query with methods like CreateFile(), Upload(), and GetContentFile().
The package automates common friction points: OAuth2 setup via settings.yaml, pagination through file listings, and efficient upload/update logic that chooses the right API method (insert, patch, or update) based on what changed. It also provides an fsspec-compatible filesystem interface for treating Google Drive like a local filesystem. Supports Python 3.8+ and carries no known security vulnerabilities.
Use it for:
- Automate bulk file uploads or downloads to/from Google Drive in a data pipeline or backup script.
- Build a Python application that needs OAuth2-authenticated access to a user's Drive without writing low-level API boilerplate.
- Implement file listing and search with automatic pagination handling across large Drive directories.
- Use Google Drive as a remote filesystem backend via fsspec for seamless integration with tools like DVC or data processing workflows.
- Manage shared Drive resources programmatically (create, update, delete files) in a team collaboration tool.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyDrive2 simplifies Google Drive API V2 operations by wrapping the low-level client library into object-oriented classes and automating OAuth2 authentication, file uploads, downloads, and pagination.
Yes. PyDrive2 is actively maintained, carries no known vulnerabilities, has low install friction, and solves a real problem—Google Drive API V2 is verbose and requires careful OAuth2 setup. If you need to interact with Google Drive from Python, this wrapper saves substantial boilerplate. The permissive Apache 2.0 license poses no restriction. The only gotcha is the OAuth2 flow setup; read the documentation first.
Install
pydrive2 on PyPI
pip
pip install pydrive2uv
uv add pydrive2poetry
poetry add pydrive2Installing PyDrive2
Before you install
Low install friction with a pure Python wheel. Actively maintained as of 2026-08-05 with recent release activity; maintained by the DVC project team. Five runtime dependencies including google-api-python-client and oauth2client handle the underlying API and authentication.
License in practice
Licensed under Apache License 2.0 (permissive), allowing use in commercial and private projects with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install PyDrive2
from pydrive2.auth import GoogleAuth
from pydrive2.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
file_list = drive.ListFile({'q': "'root' in parents"}).GetList()
Requires client_secrets.json from Google API Console and local web server access for OAuth2 authentication flow.
Verify before relying
- Whether the fsspec integration (GDriveFileSystem) is production-ready or still experimental.
- Performance characteristics when handling large file uploads or working with deeply nested directory structures.
- Concurrency guarantees beyond the stated thread-safety claim—whether it handles quota limits or rate limiting.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — google-api-python-client, oauth2client, PyYAML, cryptography, pyOpenSSL |
| Maintenance | actively maintained — 623 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,084,027/month — #4,390 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: PyDrive2-1.21.3-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
PyDrivePyDrive wraps the Google Drive API into Python…
unclear · top 15,000 on PyPI
gdrive-fsspecProvides a fsspec-compatible filesystem…
permissive · top 15,000 on PyPI
requests-oauthlibAdds OAuth 1 and OAuth 2 authentication support…
permissive · top 1,000 on PyPI
google-resumable-mediaHandles resumable uploads and downloads for…
permissive · top 1,000 on PyPI
oauth2clientoauth2client is a deprecated OAuth 2.0 client…
permissive · top 1,000 on PyPI
dvc-gdriveEnables DVC to store and retrieve data from…
permissive · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
edx-rest-api-clientProvides OAuth2 and JWT utilities for…
permissive · top 15,000 on PyPI
gcs-oauth2-boto-pluginProvides OAuth 2.0 authentication for Google…
permissive · top 15,000 on PyPI
dvc-objectsProvides filesystem and object-database…
permissive · top 5,000 on PyPI