Skip to main content

Convenient Filesystem interface over GCS

Project description

gcsfs

|Build Status| |Docs|

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 passing asynchronous=True to the GCSFileSystem constructor.


Support

Work on this repository is supported in part by:

"Anaconda, Inc. - Advancing AI through open source."

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcsfs-2026.7.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcsfs-2026.7.0-py3-none-any.whl (91.1 kB view details)

Uploaded Python 3

File details

Details for the file gcsfs-2026.7.0.tar.gz.

File metadata

  • Download URL: gcsfs-2026.7.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for gcsfs-2026.7.0.tar.gz
Algorithm Hash digest
SHA256 2df36ce1e9010e76dc4295774030495a97496838483c619e9f63bc0ab7bdc770
MD5 cef3b73f9e39a53d8b5403dc6c493c2e
BLAKE2b-256 d33358e23c6f492e091c2f01ae1bffe331aa97e18a0b3d24ff90ef648335ddc8

See more details on using hashes here.

File details

Details for the file gcsfs-2026.7.0-py3-none-any.whl.

File metadata

  • Download URL: gcsfs-2026.7.0-py3-none-any.whl
  • Upload date:
  • Size: 91.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for gcsfs-2026.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ce6c08ea64302d8fd4bc23a615ccd9e7752541cde1a88ec8362109bd79cde78
MD5 7f7f56c7bb34fa4e41e9e8bc4a02ec4c
BLAKE2b-256 efeba5c4b39903928e6be7735cc7aa31b6c3bbf3d887419e1e7ac751dba02233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page