blobfile

3.2.0 · active · verified Wed Apr 08

blobfile is a Python library that provides a unified interface for reading and writing files across local and remote blob storage systems, including Google Cloud Storage (GCS) and Azure Blob Storage (ABS). It offers an API similar to Python's built-in `open()` function, along with equivalents of common `os.path` and `shutil` operations. The current version is 3.2.0, released in April 2026, with a release cadence of approximately one major version per year.

Warnings

Install

Imports

Quickstart

This example demonstrates writing to, checking the existence of, and reading from a file in Google Cloud Storage using blobfile.

import blobfile as bf

# Write a file to Google Cloud Storage
with bf.BlobFile('gs://my-bucket-name/cats', 'wb') as f:
    f.write(b'meow!')

# Check if the file exists
print('exists:', bf.exists('gs://my-bucket-name/cats'))

# Read the file back
with bf.BlobFile('gs://my-bucket-name/cats', 'rb') as f:
    print('contents:', f.read())

view raw JSON →