AWS Module

Everything related to AWS. In the future, we may support other cloud providers.

class sobe.aws.AWS[source]

Bases: object

__init__(config)[source]
Parameters:

config (AWSConfig)

Return type:

None

delete(prefix, remote_filename)[source]

Delete a file, if it exists. Returns whether it did.

Return type:

bool

Parameters:
  • prefix (str)

  • remote_filename (str)

generate_needed_permissions()[source]

Return the minimal IAM policy statement required by the tool.

Return type:

str

invalidate_cache()[source]

Create and wait for a full-path CloudFront invalidation. Iterates until completion.

list(prefix)[source]

Return a list of object filenames in the given prefix.

Return type:

list[str]

Parameters:

prefix (str)

upload(prefix, local_path, remote_name='', *, content_type='')[source]

Upload a file.

Return type:

None

Parameters:
  • prefix (str)

  • local_path (Path)

  • remote_name (str)

  • content_type (str)

sobe.aws.guess_content_type(path)[source]

Return a guessed content type for the given file.

Return type:

str

Parameters:

path (Path)