skillfed

PyDrive2

Google Drive API made easy. Maintained fork of PyDrive.

pydrive2 v1.21.3 1.1M downloads/30d#4,390 on PyPI670
Permissive license Apache License 2.0 Active released

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 pydrive2

uv

uv add pydrive2

poetry

poetry add pydrive2

Installing 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

Development Status :: 4 - BetaProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

google drive api wrapperoauth2 google driveupload download files google drivegoogle drive file managementdrive api pythongoogle drive paginationfsspec google drive
google-driveoauth2file-management

More WWW/HTTP packages