Helper for AWS services like S3 written in python...
Project description
Helper for AWS services like S3 written in python…
Prerequisites
IAM user with read access to S3 and its secret keys
AWS CLI configured with the secret keys
Python, Pip
Getting Started
Assuming that the configuration of AWS CLI using the corresponding secret keys of the IAM user, set up your environment using Python and virtualenv and install the library using pip once the virtual environment is activated:
$ pip install py-aws-helper
Using s3objectfinder
Sample snippet:
>>> from py_aws_helper import s3objectfinder
>>> bucket='' # provide bucket name
>>> file_name='' # provide file name
>>> output = s3objectfinder.find_object(bucket=bucket, file_name=file_name)
>>> print('Total objects fetched: ', output['total_objects_fetched'])
>>> print('Total objects matched: ', output['total_objects_matched'])
>>> for key in output['matched_keys']:
print('Key: ', key)
Other arguments:
The s3objectfinder module can take in two additional paramters other than the bucket and file_name namely , “prefix” and “delimiter” whose default values have been initiated as empty strings.
The corresponding documentation for populating the “prefix” and “delimiter” arguments can be found here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.