aws_connections.s3 package

Submodules

aws_connections.s3.s3_dir_ops module

class aws_connections.s3.s3_dir_ops.S3Dir(*args, **kwargs)[source]

Bases: RemoteDir

DEFAULT_KWARGS = {'Path': None, 'bucket': None, 'conn': None, 'path': None, 'uri': None}
INSTANCE_METHOD_ATTS = ['bucket', 'path', 'conn']
STATIC_METHOD_SUFFIX = '_dir'
URI_PREFIX = 's3://'
static copy_dir(bucket: str, path: str, conn: Connection, *args, destination: str = '', destination_bucket=None, **kwargs)[source]
static create_dir(*args, **kwargs)[source]
static download_dir(bucket: str, path: str, conn: Connection, *args, destination: str = '', **kwargs)[source]
static exists_dir(bucket: str, path: str, conn: Connection, **kwargs)[source]
static get_size_dir(bucket: str, path: str, conn: Connection, *args, **kwargs)[source]
static join_uri(bucket: str, path: str) str[source]

Given a bucket and a path, generate the S3 uri

static list_files_dir(bucket: str, path: str, conn: Connection, print_off: bool = False, **kwargs)[source]
static list_subfolders_dir(bucket: str, path: str, conn: Connection, print_off: bool = False, **kwargs) List[str][source]
print_imp_atts(**kwargs)[source]

Prints off (or returns a string) with the ‘important’ information about a class Most child classes will redefine this method with custom attributes to print off

print_one_line_atts(**kwargs)[source]

Prints off (or returns a string) with information about a class in one line Most child classes will redefine this method with custom attributes to print off

static remove_dir(bucket: str, path: str, conn: Connection, *args, **kwargs) bool[source]
static split_uri(uri: str) Tuple[str, str][source]

returns bucket and path uri looks like: ‘s3://bucketname/path/to/file

static upload_dir(bucket: str, path: str, conn: Connection, *args, destination: str = '', **kwargs)[source]
class aws_connections.s3.s3_dir_ops.S3Dirs(*args, **kwargs)[source]

Bases: RemoteDirs

class aws_connections.s3.s3_dir_ops.S3Path(*args, **kwargs)[source]

Bases: S3Dir, RemotePath

INSTANCE_METHOD_ATTS = ['bucket', 'path', 'conn']
STATIC_METHOD_SUFFIX = '_path'
static copy_path(bucket: str, path: str, conn: Connection, *args, destination: str = '', destination_bucket=None, **kwargs)[source]
static create_path(bucket: str, path: str, conn: Connection, *args, string='', **kwargs)[source]
static download_path(bucket: str, path: str, conn: Connection, *args, destination: str = '', **kwargs)[source]
static exists_path(bucket: str, path: str, conn: Connection, *args, **kwargs)[source]
static get_size_path(bucket: str, path: str, conn: Connection, **kwargs) float[source]
print_imp_atts(**kwargs)[source]

Prints off (or returns a string) with the ‘important’ information about a class Most child classes will redefine this method with custom attributes to print off

static read_path(bucket: str, path: str, conn: Connection, *args, **kwargs)[source]

download the s3 file to a local path and read the contents

static remove_path(bucket: str, path: str, conn: Connection, *args, **kwargs)[source]
static rename_path(bucket: str, path: str, conn: Connection, *args, destination: str = '', destination_bucket=None, **kwargs)[source]
static upload_path(bucket: str, path: str, conn: Connection, *args, destination: str = '', **kwargs)[source]
static write_path(bucket: str, path: str, conn: Connection, *args, **kwargs)[source]

write to a local file, then upload to S3

class aws_connections.s3.s3_dir_ops.S3Paths(*args, **kwargs)[source]

Bases: S3Dirs, RemotePaths

aws_connections.s3.s3_dir_ops.set_connection(**kwargs)[source]

Module contents