boto3
Official AWS SDK for Python — interact with S3, EC2, DynamoDB, Lambda, and 200+ AWS services.
Your app needs to store user uploads in S3, send emails via SES, trigger a Lambda function, or read from DynamoDB. The AWS Console is for humans — you need to do this from code, with proper credentials, error handling, and pagination.
Boto3 has two layers: resource (high-level, Pythonic objects like `s3.Bucket`) and client (low-level, 1:1 mapping to AWS API calls). Resources are friendlier for common tasks; clients give you full control. Both share the same credential chain (env vars → ~/.aws/credentials → IAM role).
Upload a file to S3
import boto3
s3 = boto3.client('s3')
s3.upload_file(
Filename='local_file.pdf',
Bucket='my-bucket',
Key='uploads/file.pdf'
)
url = s3.generate_presigned_url(
'get_object',
Params={'Bucket': 'my-bucket', 'Key': 'uploads/file.pdf'},
ExpiresIn=3600
)Use it when
Any Python code running against AWS services: uploading to S3, querying DynamoDB, invoking Lambda, sending SQS messages, managing EC2 instances.
Skip it when
Infrastructure provisioning — use CDK, Terraform, or CloudFormation instead. If you're on Google Cloud or Azure, use their respective SDKs.
Ready to explore the full API?
See every class, function, and relationship in an interactive graph.