-
Notifications
You must be signed in to change notification settings - Fork 64
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
Implement shutils equivalent (clutils) that has the same API but accepts AnyPath #189
Comments
Yeah, I definitely appreciate that copying (especially trees) is annoying when using the That said, I'm not inclined to develop, support, and maintain our own Like you mention, I could see having a That said, I'm happy to keep this open for discussion and other opinions.
Separately, |
Having This is also partly related to some of the typing issues we've encountered with |
Thanks for the answer !
I also the method that would make CloudPath the closest to actual PathLib is the custom An interesting solution can be found here : https://pypi.org/project/libs3/ Feel like
Ha my bad, just assumed it was only for files, I feel dumb ! Thanks for that ! 😅 |
Hi, thanks for your awesome library ! Have been searching for a way to use both local and cloud path seamlessy and here it is :D
One particular problem I have with
AnyPath
is that since local paths are redirected to Pathlib, some function are not available, especiallycopy
andcopytree
. the reason is that the function to copy are located in the moduleshutil
and not associated to the a class method.As a consequence we can easily copy one cloud folder to another cloud platform, but we cannot easily upload a whole folder from your local filesystem.
path.copy
is not available andshutil.copy
obviously only works on strings and Path objects.The two ways I see to solve the problem is either to have a LocalPath class (that basically clones PathLib except for copy methods that are compatible to a cloud destination), or to propose a custom
shutil
module (from cloudpathlib import AnyPath, shutil
) that would give a standaloneshutil.copytree
function that would be compatible with any path object, local or cloud.What's your opinion on this ?
PS: for now, I use the
path.upload_from
function, which works but only for files (and is not very similar toshutil.copy
) and I am in a position where acopytree
function that would not require me to code a custome function would be nice.Thanks !
Clément
The text was updated successfully, but these errors were encountered: