» pip install botocore
» pip install types-botocore
it has been suggested to me (mostly by people here) many times that i should use boto3 instead of botocore. many people (mostly here) have indicated that they use boto3 while no one (everywhere) has indicated that they use botocore. why? what's wrong with botocore?
Botocore is the foundation that underpins the AWS CLI and also Boto 3, while Boto 3 is the official python SDK for AWS.
As others have said, Boto3 provides a cleaner API which will make your code more readable. Consider the following example usage, both examples achieve the same result but Boto 3 does it with fewer lines and fewer characters:
Botocore:
import botocore.session
session = botocore.session.get_session()
client = session.create_client('ec2', region_name='us-west-2')
response = client.describe_instances()
Boto 3:
import boto3
ec2 = boto3.client('ec2')
response = ec2.describe_instances()
Use whatever’s best for what you need to get done. Boto3 makes a bunch of calls to botocore to get stuff done, it just makes some operations less verbose or more streamlined.