
🗂️ Cloudpath
Optimized pathlib backend for Google Cloud.
A filesystem abstraction similar to pathlib that is extensible to new
filesystems. Comes with support for local filesystems and GCS buckets.
path = cloudpath.Path('gs://bucket/path/to/file.txt')
path.parent
path.name
path.stem
path.suffix
path.read(mode='r')
path.read(mode='rb')
path.write(content, mode='w')
path.write(content, mode='wb')
with path.open(mode='r') as f:
pass
path.parent.glob('*')
path.exists()
path.isdir()
path.isfile()
(path.parent / 'foo').mkdir()
path.remove()
path.parent.rmtree()
path.copy(path.parent / 'copy.txt')
path.move(path.parent / 'moved.txt')