OpenS3 Utils

exception openS3.utils.S3IOError[source]

Generic exception class for S3 communication errors.

openS3.utils.b64_string(byte_string)[source]

Return an base64 encoded byte string as an ENCODING decoded string

openS3.utils.get_valid_filename(string_to_clean)[source]

Returns the given string converted to a string that can be used for a clean filename. Specifically, leading and trailing spaces are removed; other spaces are converted to underscores; and anything that is not a unicode alphanumeric, dash, underscore, or dot, is removed.

>>> get_valid_filename("john's portrait in 2004.jpg")
'johns_portrait_in_2004.jpg'
openS3.utils.strpawstime(timestamp)[source]

Return datetime from parsed AWS header timestamp string. AWS Datetime Format: Wed, 28 Oct 2009 22:32:00 GMT

openS3.utils.validate_values(validation_func, dic)[source]

Validate each value in dic by passing it through func. Raise a ValueError if validation_func does not return True.

Previous topic

Changelog

This Page