fsspec/gcsfs
소개
Pythonic file-system interface for Google Cloud Storage
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalgcsfs
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.
Getting Started
Installation
Install via pip or conda:
# Using pip
pip install gcsfs
# OR using conda
conda install -c conda-forge gcsfs
Basic Usage
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()
Specialized Bucket Support
GCSFS now automatically supports advanced Google Cloud Storage features through its ExtendedFileSystem implementation.
1. Hierarchical Namespace (HNS)
Hierarchical Namespace (HNS) replaces the traditional "flat" GCS structure with true logical directories.
- Atomic Renames: Moving or renaming a directory is an
O(1)metadata operation. No more slow "copy-then-delete" for large folders. - High Performance: Offers up to 8x higher initial Queries Per Second (QPS) for read/write operations.
- AI/ML Ready: Ideal for heavy checkpointing and managing millions of small files.
2. Rapid Buckets (Zonal Storage)
Rapid Buckets are zonal storage resources designed for ultra-low latency and maximum throughput.
- Zonal Co-location: Place your data in the same zone as your GPU/TPU clusters to minimize network lag.
- True Appends: Unlike standard GCS objects, you can append data to existing objects in Rapid buckets without a full rewrite.
- Streaming I/O: Optimized for high-speed model loading and real-time logging.
Integration & Auth
GCSFS plays nicely with the rest of the Python data ecosystem.
Authentication Modes
- Default: Uses your local gcloud credentials or environment service accounts.
- Cloud: Explicitly use Google Metadata service (
token='cloud'). - Anonymous: Access public data without a login (
token='anon'). - Service Account: Pass the path to your JSON key file (
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.
Telemetry
GCSFS includes lightweight, automatic usage telemetry that sends structured attribution in the x-goog-storage-gcsfs-features header on HTTP and gRPC requests: upstream calling framework (such as Pandas, PyTorch, Ray, Dask, datasets, and transformers), top-level public method name (and post-open file operations), whether allowlisted method flags (recursive, detail, withdirs, prefix, cache_options) are enabled, and compute environment (gce, gke, oth). This helps prioritize performance optimizations and maintain ecosystem compatibility.
- Privacy Guaranteed: Only recognized open-source library names, public method names, whether allowlisted method flags are enabled (truthy, including defaults), and environment categories (
gce,gke,oth) are recorded. No user data, object keys, file paths, argument values, cluster or instance names, credentials, or code logic are ever collected or transmitted. - Opt-out: Telemetry can be disabled at any time by setting the standard environment variable
DO_NOT_TRACK=1orGCSFS_NO_TELEMETRY=true(or1/yes).
For full details, see the Telemetry Documentation.
Support
Work on this repository is supported in part by:
"Anaconda, Inc. - Advancing AI through open source."
관련 프로젝트 살펴보기
불러오는 중…