用于 Google Cloud 存储的 Python 文件系统接口
GCSFS 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 gcsfsimport 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."
暂无开放 Issues,或尚未同步最近议题。