bucket_upload_file - jaybgager/tracertools GitHub Wiki

[!WARNING] An existing file in the bucket folder with the same name as the file being uploaded will be overwritten.

Uploads a file onto a cloudfiles-managed S3-style bucket. Requires permission to write to the bucket.

Arguments:

  • local_path (string, mandatory)
    • the absolute path on your local machine to the file you want to upload
  • bucket_path (string, mandatory)
    • the absolute path on the bucket to the folder where you want to upload the file
    • must include file extension if one was present in original
    • this will create new folders where none exist

Example

INPUT:

import tracertools as tt

tt.bucket_upload_file(
    local_path = "/home/username/path/to/file"
    bucket_path = "bucket://path/to/upload/folder"
)

This will make the file's absolute path on the bucket bucket://path/to/upload/folder/file.