DevOps & Cloud

boto3

The remote control that lets Python code push every button inside Amazon's cloud.

Install it: pip install boto3

What does it do?

boto3 is the official toolkit that lets Python code control Amazon Web Services — spinning up servers, storing files, sending emails, managing databases, and hundreds of other cloud services, all through Python code instead of clicking around a web console. Rather than manually logging into AWS’s website to, say, upload a file to storage, a developer can write a few lines of Python that do it automatically, every time, exactly the same way. Because AWS offers such an enormous range of services, boto3 is correspondingly huge, covering nearly every corner of what Amazon’s cloud platform can do. It’s less a single tool and more a complete steering wheel for one of the world’s largest cloud computing platforms.

See it in action

This code connects to Amazon’s cloud storage, uploads a photo file to it, and then lists the names of every file stored in that storage bucket.

import boto3

s3 = boto3.client(
    "s3",
    aws_access_key_id="your_access_key_here",
    aws_secret_access_key="your_secret_key_here",
)

s3.upload_file("path/to/file.jpg", "my-bucket-name", "file.jpg")

for obj in s3.list_objects_v2(Bucket="my-bucket-name").get("Contents", []):
    print(obj["Key"])

Why would a non-developer care?

An enormous share of the internet’s infrastructure — apps, websites, backend systems — runs on Amazon Web Services rather than physical company-owned servers, and boto3 is how Python code actually operates that infrastructure programmatically instead of requiring a human to click through a web dashboard for every task. That automation is the difference between manually managing cloud resources one at a time and having code that can provision, scale, or tear down infrastructure automatically and reliably. It matters to essentially anyone whose favorite app or website has ever silently scaled up during a traffic spike.

Real-world examples

Countless companies, from small startups to major enterprises, use boto3 as the backbone of scripts and automated systems that manage their AWS infrastructure, from backing up databases to processing files uploaded by users to a service like Amazon S3. It’s especially common in data engineering, where Python scripts using boto3 move files between storage, trigger processing jobs, and manage cloud resources as part of a larger pipeline. Without it, managing AWS resources from Python would mean manually constructing raw API requests to Amazon’s cloud services.

Who uses it

Developers, data engineers, and DevOps teams who need to programmatically manage AWS cloud resources rather than clicking through the AWS web console.

How it compares to alternatives

The Azure SDK for Python and Google Cloud’s Python client library serve the same role for their respective cloud platforms, but none of them are interchangeable since each only speaks its own provider’s cloud services. Terraform, a separate infrastructure tool, describes cloud resources declaratively rather than through step-by-step code the way boto3 does. For anything specifically on AWS, boto3 is effectively the default choice for Python developers.

Fun fact

Boto is named after a species of freshwater dolphin native to the Amazon river, a playful nod to Amazon Web Services.

New to Python and want to actually try libraries like this yourself?

Find a beginner-friendly course

Related libraries