Boto is a Python based API to Amazon’s AWS resources. Boto 3 is the most current release (as of Jan 2019). All of the examples on this page use Boto 3.
You can install Boto (Boto 3 in this example) using
$ pip install boto3
Before you can access any AWS resources, you need to setup credentials for Boto to use. Boto can use the credentials that are by default saved in
~/.aws/credentials (when setup using the AWS CLI). It will use the
default profile by, well, default.
Then you import Boto into your Python file:
Using S3 With Boto
Assuming you have setup the credentials correctly, you can print out a list of all buckets with:
for bucket in s3.buckets.all(): print(bucket.name)
- AWS Command-Line Interface
- Adding Shurikens
- Python Generators
- February 2019 Updates
- Python Classes And Object Orientated Design