-
Notifications
You must be signed in to change notification settings - Fork 67
Set local_cache_dir from environment variable? #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @indigoviolet, good point. We should allow specifying a We should check for this in in
Would be happy to accept a PR if you're so inclined. PR should include tests and docs. |
Thanks @pjbull, I will try to do that. Another point I noticed was that there isn't a clean way to set up persistence/local_cache_dir while being agnostic to the type of path via AnyPath -> CloudPath. Do you have a suggestion for how to do that? |
Yep, that should be doable with For example: from cloudpathlib import AnyPath, S3Client
s3 = S3Client(local_cache_dir="./data")
s3.set_as_default_client()
cp = AnyPath("s3://test-bucket/file.txt")
cp.client._local_cache_dir
#> PosixPath('data') |
This has beed added and shipped @indigoviolet. Try install |
If I want a persistent cache, I can set
CLOUPATHLIB_FILE_CACHE_MODE
. But I then have to pass alocal_cache_dir
in code - why not allow this to also be set from the environment?The text was updated successfully, but these errors were encountered: