Skip to main content

Concurrent Google Drive folder downloader with tqdm progress bars

Project description

grgdrive-dl

A concurrent Google Drive folder downloader built on the official google-api-python-client SDK. Downloads up to 5 files in parallel, shows a tqdm progress bar, and is installable in one command.

pip install grgdrive-dl
grgdrive-dl -c credentials.json -f "https://drive.google.com/drive/folders/<ID>" -d ./output

Features

  • Official SDK — uses google-api-python-client + google-auth (service account auth)
  • Concurrent downloadsThreadPoolExecutor with configurable worker count (default 5)
  • Progress bar — live tqdm progress across all files
  • Recursive — walks nested folder trees automatically
  • Google-native export — Docs → PDF, Sheets → XLSX, Slides → PDF, Drawings → PNG
  • Skip-existing flag — resume interrupted downloads without re-downloading
  • Shared Drive support--all-drives flag for Team Drives
  • PyPI packagepip install and use as a CLI or Python library

Installation

pip install rgsuhas-drive-downloader

Requires Python 3.9+.


Authentication

This tool uses a Google Cloud Service Account.

  1. Go to the Google Cloud Console.
  2. Create or select a project and enable the Google Drive API.
  3. Create a Service Account under IAM & Admin → Service Accounts.
  4. Download the JSON key file for that service account.
  5. Share your Drive folder with the service account's email (found in the JSON as client_email).

Usage

CLI

rgdrive-dl --credentials path/to/sa-key.json \
         --folder "https://drive.google.com/drive/folders/FOLDER_ID" \
         --dest ./my-downloads
Flag Short Default Description
--credentials -c required Path to Service Account JSON key
--folder -f required Drive folder ID or share URL
--dest -d . Local destination directory
--workers 5 Concurrent download threads
--all-drives off Include Shared Drive items
--skip-existing off Skip already-downloaded files

Example — resume a partial download with 8 threads:

rgdrive-dl -c sa-key.json -f 1A2B3C4D5E --dest ./data --skip-existing --workers 8

Python API

from gdrive_dl import GoogleDriveClient, FolderDownloader

client = GoogleDriveClient("path/to/sa-key.json")

downloader = FolderDownloader(
    client,
    include_all_drives=False,
    skip_existing=True,
    max_workers=5,
)

downloader.download(folder_id="1A2B3C4D5E6F", dest_dir="./output")

Example Output

rgdrive-dl 1.0.0
  folder  : 1A2B3C4D5EFGhijklmno
  dest    : ./output
  workers : 5

Collecting file list…
Found 42 file(s) to process.

  download   report_2024.pdf
  download   dataset.csv
  download   presentation.pptx
  exported   notes (Google Doc) → notes.pdf
Progress: 100%|████████████████████| 42/42 [00:18<00:00,  2.3 file/s]

All done.

Publishing to PyPI

# Install build tools
pip install build twine

# Build the distribution
python -m build

# Upload to PyPI (requires a PyPI account + API token)
twine upload dist/*

Development

git clone https://github.com/rgsuhas/drive-downloader.git
cd drive-downloader
pip install -e ".[dev]"

License

MIT © Suhas RG

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rgdrive_dl-1.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rgdrive_dl-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file rgdrive_dl-1.0.0.tar.gz.

File metadata

  • Download URL: rgdrive_dl-1.0.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rgdrive_dl-1.0.0.tar.gz
Algorithm Hash digest
SHA256 12f1485d96694343b2940c5eda76a8006177e6b9fced72e39be434843d0de7a1
MD5 de95e7aba61156814ba0bcbf1dbe4f08
BLAKE2b-256 96aca1434926d994f9d1e82424e93e19d5a25ce1acf4a711bc9f05baf6e70c56

See more details on using hashes here.

File details

Details for the file rgdrive_dl-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rgdrive_dl-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rgdrive_dl-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dfa196aac4c3de7c0488207939456792065d6949663943da4ebf1e1f8ec28ef
MD5 0107426ab5e86a683379277ada25b919
BLAKE2b-256 5e07f80ea75baf961373cd9f4fbf0cd97c0233d33a38c93f973aad70590a1ae4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page