Python AWS boto 和 boto3 有什么区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32322503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between the AWS boto and boto3
提问by Matt
I'm new to AWS using Python and I'm trying to learn the boto API however I noticed that there are two major versions/packages for Python. That would be boto and boto3.
我是使用 Python 的 AWS 新手,我正在尝试学习 boto API,但是我注意到 Python 有两个主要版本/包。那将是 boto 和 boto3。
What is the difference between the AWS boto and boto3 libraries?
AWS boto 和 boto3 库之间有什么区别?
采纳答案by garnaat
The botopackage is the hand-coded Python library that has been around since 2006. It is very popular and is fully supported by AWS but because it is hand-coded and there are so many services available (with more appearing all the time) it is difficult to maintain.
该博托包是手工编写Python库自2006年以来即一直围绕这是非常流行,并通过AWS是完全支持,但因为它是手工编码,有这么多的服务(有更多的出现所有的时间),它很难维护。
So, boto3is a new version of the boto library based on botocore. All of the low-level interfaces to AWS are driven from JSON service descriptions that are generated automatically from the canonical descriptions of the services. So, the interfaces are always correct and always up to date. There is a resource layer on top of the client-layer that provides a nicer, more Pythonic interface.
因此,boto3是基于botocore的 boto 库的新版本。AWS 的所有低级接口都是由 JSON 服务描述驱动的,这些描述是从服务的规范描述自动生成的。因此,接口始终是正确的并且始终是最新的。在客户端层之上有一个资源层,它提供了一个更好、更 Pythonic 的界面。
The boto3 library is being actively developed by AWS and is the one I would recommend people use if they are starting new development.
AWS 正在积极开发 boto3 库,如果人们开始新的开发,我会推荐他们使用 boto3 库。