Using Boto 3, you can integrate your Python application, library, or script with Amazon S3, Amazon EC2, Amazon DynamoDB, and more.
Key Features of Boto3
- Resource APIs.
- Up-to-date and Consistent Interface.
- Support for Python 2 and 3.
- Waiters.
- Service-specific High-level Features.
Resource APIs
Boto 3 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. For 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
It 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 Boto 3 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.
To learn more about boto3 please refer to AWS SDK for Python (Boto3) Documentation
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 Boto 3’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.
Very informative
I am beginner in AWS environment, and this article, already solved many queries.