Pythonic file-system interface for Google Cloud Storage
See the codeGCSFS is a Python library that provides a familiar, file-system-like interface to Google Cloud Storage (GCS). Built on top of fsspec, it allows you to interact with cloud buckets as if they were local directories, making it a favorite for data scientists and engineers.
Install via pip or conda:
# Using pip
pip install gcsfs
# OR using conda
conda install -c conda-forge gcsfs
import gcsfs
# Initialize the filesystem
fs = gcsfs.GCSFileSystem(project='my-google-project')
# List files in a bucket
files = fs.ls('my-bucket')
# Read a file directly into a string/bytes
with fs.open('my-bucket/data.txt', 'rb') as f:
content = f.read()
GCSFS now automatically supports advanced Google Cloud Storage features through its ExtendedFileSystem implementation.
Hierarchical Namespace (HNS) replaces the traditional "flat" GCS structure with true logical directories.
O(1) metadata operation. No more slow "copy-then-delete" for large folders.Rapid Buckets are zonal storage resources designed for ultra-low latency and maximum throughput.
GCSFS plays nicely with the rest of the Python data ecosystem.
token='cloud').token='anon').token='path/to/key.json').[!TIP] Note on Async: GCSFS is built on
aiohttp. If you are building high-concurrency applications, you can use the asynchronous API by passingasynchronous=Trueto theGCSFileSystemconstructor.
Work on this repository is supported in part by:
"Anaconda, Inc. - Advancing AI through open source."
328 followers · starred Jun 2018
265 followers · starred Aug 2020
188 followers · starred Dec 2024
326 followers · starred Jan 2026
Pythonic file-system interface for Google Cloud Storage
See the codeGCSFS is a Python library that provides a familiar, file-system-like interface to Google Cloud Storage (GCS). Built on top of fsspec, it allows you to interact with cloud buckets as if they were local directories, making it a favorite for data scientists and engineers.
Install via pip or conda:
# Using pip
pip install gcsfs
# OR using conda
conda install -c conda-forge gcsfs
import gcsfs
# Initialize the filesystem
fs = gcsfs.GCSFileSystem(project='my-google-project')
# List files in a bucket
files = fs.ls('my-bucket')
# Read a file directly into a string/bytes
with fs.open('my-bucket/data.txt', 'rb') as f:
content = f.read()
GCSFS now automatically supports advanced Google Cloud Storage features through its ExtendedFileSystem implementation.
Hierarchical Namespace (HNS) replaces the traditional "flat" GCS structure with true logical directories.
O(1) metadata operation. No more slow "copy-then-delete" for large folders.Rapid Buckets are zonal storage resources designed for ultra-low latency and maximum throughput.
GCSFS plays nicely with the rest of the Python data ecosystem.
token='cloud').token='anon').token='path/to/key.json').[!TIP] Note on Async: GCSFS is built on
aiohttp. If you are building high-concurrency applications, you can use the asynchronous API by passingasynchronous=Trueto theGCSFileSystemconstructor.
Work on this repository is supported in part by:
"Anaconda, Inc. - Advancing AI through open source."
328 followers · starred Jun 2018
265 followers · starred Aug 2020
188 followers · starred Dec 2024
326 followers · starred Jan 2026