sbucket package

Submodules

sbucket.environment module

sbucket.main module

XXX: placeholder for the main command

sbucket.s3bucket module

class sbucket.s3bucket.S3Bucket(bucket_name)[source]

Bases: object

compare_file(path, local_file)[source]

Return True if the file at path in the S3 bucket is the same as the local file.

compare_file_to_s3(path, local_file)[source]

Return True if the file at path in the S3 bucket is different from the local file.

compare_timestamps(local_file, path)[source]

Return the number of seconds older the local file is than the file at path in the S3 bucket.

contents(path)[source]

Return the contents of the file at path in the S3 bucket.

copy_all_files_from(local_dir)[source]

Copy all files in the local directory to the S3 bucket.

copy_all_files_to(local_dir)[source]

Copy all files in the S3 bucket to the local directory.

copy_files_from(paths, local_dir)[source]

Copy the files at paths in the local directory to the S3 bucket.

copy_files_to(paths, local_dir)[source]

Copy the files at paths in the S3 bucket to the local directory.

copy_from_s3(path)[source]

Copy the file at path in the S3 bucket to the local directory.

copy_to_s3(local_file, path=None)[source]

Copy the file at path in the local directory to the S3 bucket.

delete_all_files()[source]

Delete all files in the S3 bucket.

delete_file(path)[source]

Delete the file at path in the S3 bucket.

delete_files(paths)[source]

Delete the files at paths in the S3 bucket.

exists(path)[source]

Return True if the file at path exists in the S3 bucket.

file(path)[source]
get_hash(path)[source]

Return the hash of the file at path in the S3 bucket.

get_metadata(path)[source]

Return the metadata of the file at path in the S3 bucket.

get_tags(path)[source]

Return the tags of the file at path in the S3 bucket.

Ref. tags set in copy_to_s3().

list_files()[source]

Return a list of all files in the S3 bucket.

list_files_in(path)[source]

Return a list of all files in the S3 bucket at path.

local_timestamp(local_file)[source]

Return the timestamp of the local file.

read_header(path)[source]

Return the header of the file at path in the S3 bucket.

s3_newer_than_local(path, local_file)[source]

Return True if the file at path in the S3 bucket is newer than the local file.

sync_file(path)[source]

Synchronize the file at path in the S3 bucket.

timestamp(path)[source]

Return the timestamp of the file at path in the S3 bucket.

sbucket.s3file module

class sbucket.s3file.File(path)[source]

Bases: ABC

abstract property exists
abstract property hash
abstract property timestamp
class sbucket.s3file.LocalFile(path)[source]

Bases: File

property exists: bool
property hash: str
property timestamp: int
class sbucket.s3file.S3File(bucket, path)[source]

Bases: File

download()[source]
property exists
property hash
property timestamp
update_tags(tags)[source]
sbucket.s3file.get_timestamp(path) datetime[source]

Return the timestamp of the file at path with no fractional seconds.

sbucket.s3file.hash_file(fname)[source]
sbucket.s3file.local_timezone()[source]

Return the local timezone.

Module contents