Using Boto3, you can integrate your Python application, library, or script with Amazon S3, Amazon EC2, Amazon DynamoDB, and more.

Key Features

Resource APIs.
Up-to-date and Consistent Interface.
Support for Python 2 and 3.
Waiters.
Service-specific High-level Features.

 

   Resource APIs
Boto3 has two distinct levels of APIs. Client APIs provide a one-to-one mapping to underlying HTTP API operations. Using resource APIs, characteristics and activities are accessed through resource objects and collections rather than through explicit network calls.

   Up-to-date and Consistent Interface
AWS APIs are described by JSON models that are dynamically inserted into Boto3 client and resource interfaces. As a result, we are able to provide speedy updates across all the services we support.
   Support for Python 2 and 3
Boto3 supports Python 2.7+ and 3.4+ natively.
   Waiters
Boto3 comes with ‘waiters’, which automatically poll AWS resources for predefined changes. As an example, you can start an Amazon EC2 instance and use a waiter to wait until it reaches the ‘running’ state, or create a new Amazon DynamoDB table and wait until it becomes available. Both client and resource APIs have waiters in Boto3.
   Service-specific High-level Features
Boto3 has a lot of service-specific functionalities like multi-part transfers that happen automatically for Amazon S3 and query conditions that are made simpler for Amazon DynamoDB.

The boto3 library is built on top of botocore, It is a Python library that is used to send API requests to Amazon Web Services and receive responses from the service.

Fig. Level of abstraction in boto3 with botocore example

With a client, you directly interact with the response dictionary from a deserialized API response.
Using the resource, you can interact with common Python classes and objects instead of unprocessed response dictionaries.

 

Creating clients and resources for AWS DynamoDB.

Accessing table from DynamoDB using DynamoDB resource

Fetching data from DynamoDB table using getItem()

Sending data into DynamoDB table using putItem()

Query data from DynamoDB table using query()

Conclusion
In this blog, we discussed boto3’s internal design and application. As a result of examining the differences between clients and resources. In addition, we explored DynamoDB’s compatibility with Boto3.