arche.tools.s3

AWS methods. Credentials are expected to be set in environment

Module Contents

arche.tools.s3.upload_str_stream(bucket: str, key: str, stream: io.StringIO) → str

Upload a whole StringIO to S3 bucket as file.

Parameters
  • bucket – bucket name

  • key – destination path

  • stream – stream object

Returns

public url to uploaded file

arche.tools.s3.get_contents_from_bucket(bucket: str, filepath: str) → str

Fetch file contents from s3 bucket.

Parameters
  • bucket – bucket name

  • filepath – a relative path to file

Returns

utf-8 decoded string

arche.tools.s3.get_contents(url: str) → str

Fetch file contents from the remote source.

Parameters

url – uri path to a file. Allows only s3, https.

Returns

utf-8 decoded string