libera_utils.io.smart_open.smart_copy_file#
- libera_utils.io.smart_open.smart_copy_file(source_path: str, dest_path: str, delete=False)#
Copy function that can handle local files or files in an S3 bucket. Returns the path to the newly created file as a Path or an S3Path, depending on the destination.
- Parameters:
source_path (str or pathlib.Path or cloudpathlib.s3.s3path.S3Path) – Path to the source file to be copied. Files residing in an s3 bucket must begin with “s3://”.
dest_path (str or pathlib.Path or cloudpathlib.s3.s3path.S3Path) – Path to the Destination file to be copied to. Files residing in an s3 bucket must begin with “s3://”.
delete (bool) – If true, deletes files copied from source (default = False)
- Returns:
The path to the newly created file
- Return type: