snakemake/remote/S3.py
def upload_to_s3(
        self,
        bucket_name,
        file_path,
        key=None,
        use_relative_path_for_key=True,
        relative_start_dir=None,
        extra_args=None,
        config=None,
    ):
        """Upload a file to S3

        This function uploads a file to an AWS S3 bucket.

        Args:
            bucket_name: the name of the S3 bucket to use (bucket name only, not ARN)
            file_path: The path to the file to upload.
            key: The key to set for the file on S3. If not specified, this will default to the
                name of the file.
            use_relative_path_for_key: If set to True (default), and key is None, the S3 key will include slashes
                representing the path of the file relative to the CWD. If False only the
                file basename will be used for the key.
            relative_start_dir: The start dir to use for use_relative_path_for_key. No effect if key is set.

        Returns: The key of the file on S3 if written, None otherwise
        """
        file_path = os.path.realpath(os.path.expanduser(file_path))

        assert bucket_name, "bucket_name must be specified"
        assert os.path.exists(file_path), (
            "The file path specified does not exist: %s" % file_path
        )
        assert os.path.isfile(file_path), (
            "The file path specified does not appear to be a file: %s" % file_path
        )

        if not self.bucket_exists(bucket_name):
            self.s3.create_bucket(Bucket=bucket_name)

        if not key:
            if use_relative_path_for_key:
                if relative_start_dir:
                    path_key = os.path.relpath(file_path, relative_start_dir)
                else:
                    path_key = os.path.relpath(file_path)
            else:
                path_key = os.path.basename(file_path)
            key = path_key

        k = self.s3.Object(bucket_name, key)

        try:
            k.upload_file(file_path, ExtraArgs=extra_args, Config=config)
        except:
            raise
Upload a file to S3

        This function uploads a file to an AWS S3 bucket.

        Args:
            bucket_name: the name of the S3 bucket to use (bucket name only, not ARN)
            file_path: The path to the file to upload.
            key: The key to set for the file on S3. If not specified, this will default to the
                name of the file.
            use_relative_path_for_key: If set to True (default), and key is None, the S3 key will include slashes
                representing the path of the file relative to the CWD. If False only the
                file basename will be used for the key.
            relative_start_dir: The start dir to use for use_relative_path_for_key. No effect if key is set.

        Returns: The key of the file on S3 if written, None otherwise
        
Upload a file to S3
This function uploads a file to an AWS S3 bucket.
Upload a file to S3 This function uploads a file to an AWS S3 bucket .
def upload_to_s3(
        self,
        bucket_name,
        file_path,
        key=None,
        use_relative_path_for_key=True,
        relative_start_dir=None,
        extra_args=None,
        config=None,
    ):
        file_path = os.path.realpath(os.path.expanduser(file_path))
        assert bucket_name, "bucket_name must be specified"
        assert os.path.exists(file_path), (
            "The file path specified does not exist: %s" % file_path
        )
        assert os.path.isfile(file_path), (
            "The file path specified does not appear to be a file: %s" % file_path
        )
        if not self.bucket_exists(bucket_name):
            self.s3.create_bucket(Bucket=bucket_name)
        if not key:
            if use_relative_path_for_key:
                if relative_start_dir:
                    path_key = os.path.relpath(file_path, relative_start_dir)
                else:
                    path_key = os.path.relpath(file_path)
            else:
                path_key = os.path.basename(file_path)
            key = path_key
        k = self.s3.Object(bucket_name, key)
        try:
            k.upload_file(file_path, ExtraArgs=extra_args, Config=config)
        except:
            raise
def upload_to_s3 ( self , bucket_name , file_path , key = None , use_relative_path_for_key = True , relative_start_dir = None , extra_args = None , config = None , ) : file_path = os . path . realpath ( os . path . expanduser ( file_path ) ) assert bucket_name , "bucket_name must be specified" assert os . path . exists ( file_path ) , ( "The file path specified does not exist: %s" % file_path ) assert os . path . isfile ( file_path ) , ( "The file path specified does not appear to be a file: %s" % file_path ) if not self . bucket_exists ( bucket_name ) : self . s3 . create_bucket ( Bucket = bucket_name ) if not key : if use_relative_path_for_key : if relative_start_dir : path_key = os . path . relpath ( file_path , relative_start_dir ) else : path_key = os . path . relpath ( file_path ) else : path_key = os . path . basename ( file_path ) key = path_key k = self . s3 . Object ( bucket_name , key ) try : k . upload_file ( file_path , ExtraArgs = extra_args , Config = config ) except : raise
Upload a file to S3
This function uploads a file to an AWS S3 bucket.
Upload a file to S3 This function uploads a file to an AWS S3 bucket .
"""Upload a file to S3

        This function uploads a file to an AWS S3 bucket.

        Args:
            bucket_name: the name of the S3 bucket to use (bucket name only, not ARN)
            file_path: The path to the file to upload.
            key: The key to set for the file on S3. If not specified, this will default to the
                name of the file.
            use_relative_path_for_key: If set to True (default), and key is None, the S3 key will include slashes
                representing the path of the file relative to the CWD. If False only the
                file basename will be used for the key.
            relative_start_dir: The start dir to use for use_relative_path_for_key. No effect if key is set.

        Returns: The key of the file on S3 if written, None otherwise
        """
self
bucket_name
the name of the S3 bucket to use (bucket name only, not ARN)
the name of the S3 bucket to use ( bucket name only not ARN )
file_path
The path to the file to upload.
The path to the file to upload .
key
The key to set for the file on S3. If not specified, this will default to the
name of the file.
The key to set for the file on S3 . If not specified this will default to the name of the file .
use_relative_path_for_key
If set to True (default), and key is None, the S3 key will include slashes
representing the path of the file relative to the CWD. If False only the
file basename will be used for the key.
If set to True ( default ) and key is None the S3 key will include slashes representing the path of the file relative to the CWD . If False only the file basename will be used for the key .
relative_start_dir
The start dir to use for use_relative_path_for_key. No effect if key is set.
The start dir to use for use_relative_path_for_key . No effect if key is set .
extra_args
config