cloud_fs.filesystems.S3

class S3(s3_path, anon=False, profile=None, **kwargs)[source]

Bases: cloud_fs.filesystems.BaseFileSystem

S3 filesystem utilities

Parameters
  • s3_path (str) – S3 object path

  • anon (bool, optional) – Whether to use anonymous credentials, by default False

  • profile (str, optional) – AWS credentials profile, by default None

Methods

copy

Copy file within, to and from s3

glob

List objects under path that match pattern in path

ls

List objects under path

walk

Walk down directory structure

Attributes

operations

Available filesystem operations

path

File path to perform filesystem operation on

copy(src, dst, **kwargs)[source]

Copy file within, to and from s3

Parameters
  • src (str) – Source path

  • dst (str) – Destination path

glob(path)[source]

List objects under path that match pattern in path

Parameters

path (str) – path to list objects under

Returns

list – objects that exist under path

ls(path)[source]

List objects under path

Parameters

path (str) – path to list objects under

Returns

list – objects that exist under path

walk(path)[source]

Walk down directory structure

Parameters

path (str) – Path to walk down

Returns

list – root, directories, files below path

property operations

Available filesystem operations

Returns

list

property path

File path to perform filesystem operation on

Returns

str