Connect to a AWS S3 Bucket with boto3 of Python

Felipe Gonzalez
2 min readJun 14, 2021

Amazon Simple Storage Service (Amazon S3) is a storage service for different types of objects, aws s3 offers scalability, this means that they only charge what you use and you can increase the amount of space to use, also aws S3 provides features of easy-to-use administration that allows us to organize data and configure access controls. Obviously this service has a value which is proportional to the use of this service.

Image of the author

Python provides a library which allows us to connect to aws s3 as clients, this SDK is called boto3, You use the AWS SDK for Python (Boto3) to create, configure, and manage AWS services. The SDK provides an object-oriented API as well as low-level access to AWS services. In this blog we will be using the S3 client.

Frist we need to download the aws client, this allows the connection to our account of aws.

pip3 install awscli

After install the aws client, we must configure it to our account, for that type:

aws configure

And then you must introduce your Key ID, Secret Access Key and the region that your bucket its in and the format that you want to receive the data.

image took of internet

To use the library, must installed previously.

pip3 install boto3

Here is the code of one of the most basic uses in which we can use the boto3 s3 client, these uses are: create a bucket, list the buckets, upload files, delete them, list them and download them.

If you are interested in more information and more codes about it, you can go to my github: https://github.com/Felipeagq/boto3

If you want read the documentation of boto3: https://boto3.amazonaws.com/v1/documentation/api/latest/index.html

If you are interested to know more about aws s3, here is the Link: https://aws.amazon.com/es/s3/

--

--

Felipe Gonzalez

Python BackEnd Developer, Machine Learning Python and AWS (Amazon Web Service)