GCSFS
GCSFS provides a Pythonic file-system interface to Google Cloud Storage, allowing seamless interaction with GCS as if it were a local file system. The current version is 2026.3.0, and it follows a regular release cadence with updates approximately every few months.
Warnings
- breaking Default Filesystem Implementation Change: gcsfs now uses ExtendedFileSystem as the default entry point for all bucket types to support specialized storage buckets like Hierarchical Namespace (HNS) out-of-box. This change may affect existing workflows that rely on the previous default implementation.
- gotcha FUSE functionality is experimental and may change. It is not recommended for production use, and data loss could occur if not used cautiously.
Install
-
pip install gcsfs -
conda install -c conda-forge gcsfs
Imports
- GCSFileSystem
from gcsfs import GCSFileSystem
Quickstart
import gcsfs
# Initialize the GCSFileSystem
fs = gcsfs.GCSFileSystem(project='your-project-id')
# List files in a bucket
print(fs.ls('your-bucket-name'))
# Read a file
with fs.open('your-bucket-name/your-file.txt', 'rb') as f:
print(f.read())