justindujardin / pathy

simple, flexible, offline capable, cloud storage with a Python path-like interface
Apache License 2.0
171 stars 23 forks source link

Feature/local caching #11

Closed justindujardin closed 4 years ago

justindujardin commented 4 years ago

Add support for caching files locally from buckets.

Example

from gcspath import GCSPath, use_fs_cache
from pathlib import Path

use_fs_cache("/tmp/gcs_path_test/")
blob = GCSPath("/my-bucket/foo.txt")
blob.write_text("hello world!")

local_cache: Path = GCSPath.to_local(blob)
assert str(local_cache) == "/tmp/gcs_path_test/my-bucket/foo.txt"

Changes

justindujardin commented 4 years ago

:tada: This PR is included in version 0.0.10 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: