boto3_interface#
- ioapps.boto3_interface.filelist(bucket, object_path=None, profile_name=None, resource='s3')[source]#
DESCRIPTION:
This function returns a list containing the contents of a resource bucket path.
- Parameters:
- bucket: str
A Python string specifying the name of the resource bucket.
- Returns:
- filelist: List
A Python list containing the contents of the resource bucket.
- Return type:
List
- ioapps.boto3_interface.get(bucket, filedict=None, into_mem=False, object_path=None, profile_name=None, resource='s3')[source]#
DESCRIPTION:
This function downloads objects from a user specified resource bucket either onto the respective platforms local disk (into_mem = False) or into memory (into_mem = True).
- Parameters:
- bucket: str
A Python string specifying the name of the resource bucket.
- Returns:
- object_memory: NamedTemporaryFile
A Python tempfile NamedTemporaryFile object containing the contents of the resource bucket and object path specified upon entry; if the into_mem parameter is False upon entry, the returned value is NoneType.
- Raises:
- Boto3InterfaceError:
raised if parameter values provided upon entry are invalid.
raised if the downloading of a specified object path into local memory encounters and exception.
raised if the downloading of a specified object path encounters and exception.
- Return type:
NamedTemporaryFile
- ioapps.boto3_interface.put(bucket, filedict, profile_name=None, resource='s3')[source]#
DESCRIPTION:
This function uploads objects to a user specified resource bucket.
- Parameters:
- bucket: str
A Python string specifying the name of the resource bucket.
- filedict: Dict
A Python dictionary containing key and value pairs for the objects to be written to the resource bucket objects; the dictionary keys are the local file path and the respective dictionary key values are the object names.
- Raises:
- Boto3InterfaceError:
raised if the uploading of a specified object path encounters and exception.
- Return type:
None