beawolf - Fotolia


Boto gains foothold as AWS SDK for Python standard

The Boto library, now an official AWS SDK for Python, helps developers build cloud-native apps. Learn which Boto version works best and how to configure it for your environment.

Some AWS developers who use Python make Boto their go-to library. Amazon currently supports two Boto versions:...

Boto2 and Boto3, which is more in-line with other official AWS SDKs and supports a low-level interface to AWS APIs. Before using either version, developers must understand the library's purpose and its nomenclature within AWS.

In the early days of AWS, there were no official AWS SDKs for programming languages. Even though there were a few libraries to access individual services, no central SDK existed for developers fully focused on public cloud. Boto, named after a bottlenose dolphin that swims in the Amazon River, was designed to create a central SDK that could access anything developers needed to build a cloud-native application.

Boto, which later became the AWS SDK for Python, accesses resources in a similar fashion to Python. Each response from an AWS API is converted into native Python classes; each attribute is renamed into Python-style names, such as content_type instead of ContentType.

Boto's place in the development world

Boto was designed to help developers in several areas. For example, the SimpleDB connection had some functionality that made it similar to Google's BigQuery interface, which is helpful for companies using both Google Cloud Platform and AWS. Google is also willing to contribute code to the S3 module to help make it compatible with its storage option.

AWS gradually built a big Boto community, and the cloud provider adopted Boto as an official API. The library is now a fully supported product for accessing AWS APIs.

Boto, Boto3 and Botocore

When Python 3 came out, its vision was to drop support for backward compatibility -- to clean up the code base and allow improvements to the language. Boto3 had a similar intention -- help make APIs more similar to AWS SDKs in other languages and make things more intuitive for other open source developers to work with -- even if that meant dropping all backward compatibility. This is why Boto2 and Boto3 are still available, and it's not a simple process to upgrade from one to the other.

Boto2 aims to make the AWS SDK for Python friendly for its developers; it was built when Python 2 was in use and before Python 3 was in beta. Because of this, some features won't make sense to many new Python 3 developers. It may be easier for some Python 2 users, but mostly just in maintenance mode and shouldn't be used for new projects.

Boto3 has no backward compatibility with Boto. To create Boto3, the AWS team developed a new package called Botocore, which is a low-level interface to AWS APIs. Botocore handles all of the authentication schemes and provides very raw access to the APIs that's dissimilar from the AWS SDK for Python. The AWS Command Line Interface (AWS CLI) also uses Botocore.

Boto3 adds onto Botocore's basic functionality for more Python support, designed for Python 3 with backward compatibility for Python 2.

Configure access credentials with AWS SDK for Python

As with any other AWS SDK, administrators can configure Boto using environment variables or an AWS Config file or profile. Because the AWS CLI uses Boto developers can configure both simultaneously. Boto can also use AWS Identity and Access Management roles when running on an Elastic Compute Cloud instance.

Boto supports configuration files, which developers can access from other Python applications to configure services such as Simple Storage Service buckets or API keys.

Boto3 has high-level functionality built into it that other AWS SDKs and other platforms do not have. For example, developers can automatically break large files into smaller ones to assist with upload speed and make DynamoDB conditional expressions easier to use. Boto3 also includes support for data types in DynamoDB -- such as numbers, strings and dates -- that do not exist in other languages.

Boto on GitHub also contains other user-contributed libraries that sit on top of Boto, Botocore or Boto3. In addition, Botoflow is a library that eases the use of Amazon Simple Workflow Service.

Next Steps

Get to know these Python tools

Use open source tools with AWS Lambda

Ops and dev can speak the same AWS language

Dig Deeper on AWS tools for development