Apache License 2.0

项目介绍

lionheart/bottlenose 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Apache License 2.0 许可证,目前获得 573 个 Star、111 次 Fork。

仓库全名
lionheart/bottlenose
开源许可证
Apache License 2.0
Star 数
573
Fork 数
111
未关闭 Issue
5

README 摘要

Bottlenose is a thin, well-tested, maintained, and powerful Python wrapper over the Amazon Product Advertising API. There is practically no overhead, and no magic (unless you add it yourself). Before you get started, make sure you have both Amazon Product Advertising and AWS accounts. AWSACCESSKEYID, AWSSECRETACCESSKEY and AWSASSOCIATETAG are all from your Amazon Associate Account. Features [x] Compatible with…

完整内容见 GitHub 原始 README 或本页 。

常见问题

bottlenose 用什么语言开发?

主要使用 Python 编写,采用 Apache License 2.0 许可证,目前有 573 个 Star。

bottlenose 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 bottlenose 的源码?

可以直接克隆仓库:git clone https://github.com/lionheart/bottlenose.git,默认分支为 master;安装与运行步骤见仓库 README。

bottlenose 最近还在维护吗?

仓库最近一次更新为 2021年3月8日,当前有 5 个未关闭 Issue;Star 数为 573,可作为社区活跃度的参考。

关于

A Python wrapper for the Amazon Product Advertising API.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
828
价值分
380
活跃状态
活跃

语言占比

Makefile
Python

README

[][lionheart-url]

Version Version License Versions

Bottlenose is a thin, well-tested, maintained, and powerful Python wrapper over the Amazon Product Advertising API. There is practically no overhead, and no magic (unless you add it yourself).

Before you get started, make sure you have both Amazon Product Advertising and AWS accounts. AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_ASSOCIATE_TAG are all from your Amazon Associate Account.

Features

  • Compatible with Python versions 2.4 and up
  • Support for AU, BR, CA, CN, DE, ES, FR, IN, IT, JP, MX, UK, and US Amazon Product Advertising API endpoints
  • No requirements, except simplejson for Python versions before 2.6
  • Configurable query parsing
  • Configurable throttling for batches of queries
  • Configurable query caching
  • Configurable error handling and retries

Usage

pip

pip install bottlenose

or

python3 -m pip install bottlenose

Then, using your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_ASSOCIATE_TAG:

import bottlenose
amazon = bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG)
response = amazon.ItemLookup(ItemId="B007OZNUCE")

You can then parse the response output to view item information.

Troubleshooting

  • If you need help or would like to ask a general question, use Stack Overflow. Apply the ‘bottlenose’ tag to your question to get help faster.
  • If you found a bug or have a feature request, open an issue.
  • If you want to contribute, submit a pull request. If it’s a big change, please open an issue first to discuss implementation.

Advanced Usage

1. Available Search Methods
Region Endpoint

The default Region is set to US (webservices.amazon.com). To specify another endpoint, simply set the Region parameter with the request. For example, to specify the French endpoint (webservices.amazon.fr), set the Region parameter to FR:

amazon = bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG, Region='FR')

Supported values for the Region parameter are CA, CN, DE, ES, FR, IN, IT, JP, UK, and US (default).

Your Amazon Product Advertising account (AWS_ASSOCIATE_TAG) must exist for the given endpoint, otherwise, you’ll get an HTTP 400 error (‘Bad Request’).

Search for a Specific Item
response = amazon.ItemLookup(ItemId="B007OZNUCE")
Search for Items by Keywords
response = amazon.ItemSearch(Keywords="Kindle 3G", SearchIndex="All")
Search for Images for an item
response = amazon.ItemLookup(ItemId="1449372422", ResponseGroup="Images")
Search for Similar Items
response = amazon.SimilarityLookup(ItemId="B007OZNUCE")
Required
amazon = bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG)
Create a cart
response = amazon.CartCreate(...)
Adding to a cart
response = amazon.CartAdd(CartId, ...)
Get a cart by ID
response = amazon.CartGet(CartId, ...)
Modifying a cart
response = amazon.CartModify(ASIN, CartId,...)
Clearing a cart
response = amazon.CartClear(CartId, ...)
3. Sample Code
import bottlenose
amazon = bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG)
response = amazon.ItemLookup(ItemId="0596520999", ResponseGroup="Images",
    SearchIndex="Books", IdType="ISBN")
print(response)
# <?xml version="1.0" ?><ItemLookupResponse xmlns="http://webservices.amazon...

Here is another example.

response = amazon.ItemSearch(Keywords="Kindle 3G", SearchIndex="All")
# <?xml version="1.0" ?>

评论

暂无评论