Google Resumable Media

2.8.0 · active · verified Sat Mar 28

A Python library providing utilities for Google Media Downloads and Resumable Uploads. Current version: 2.8.0, released on November 11, 2025. Supports Python 3.7 and above. Release cadence: approximately quarterly.

Warnings

Install

Imports

Quickstart

This script demonstrates how to perform a chunked download using the google-resumable-media library. It downloads a large file in 1 MB chunks and writes it to 'downloaded_file'.

import os
from google.resumable_media.requests import ChunkedDownload

# Set up the media URL and destination stream
media_url = 'https://example.com/largefile'
stream = open('downloaded_file', 'wb')

# Initialize ChunkedDownload
chunk_size = 1024 * 1024  # 1 MB
download = ChunkedDownload(media_url, chunk_size, stream)

# Consume the download in chunks
while not download.finished:
    download.consume_next_chunk()
    print(f'Downloaded {download.bytes_downloaded} bytes')

# Close the stream
stream.close()

view raw JSON →