cloudpathlib
cloudpathlib copied to clipboard
Create API specifications for Backends/Clients
We don't have a full definition of what we rely on each backend function to do. For example, this just came up in #52 when we were discussing if _download_file should create non-existent parent directories.
Some example q's to specify:
- Should functions create non-existent parent directories or not? For most blob store backends,
_upload_filewon't complain if a portion of the "path" does not exist. However, for_download_file, it's usually the case thatpathlibwon't create non-existent parent directories for you. - Should we overwrite existing files on the cloud or locally? (
_move_file,_upload_file,_download_file) - Should
_list_dirinclude itself? - Which functions should have "cloud native" implementations? (E.g.,
_move_fileshould prefer to issue commands to the backend rather than streaming files through the local machine). - Should
_get_metadatahave a specified return format or should we just let the relevantPathclass handle picking out what a user should want from adict? - Should we formalize
_is_file_or_diras a required method with enumerated responses?