New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amaboko

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amaboko

get book information by ISBN in some regions

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

amaboko - Amazon Book Information API

just wrapping Amazon Simple Product API

Dependencies

  • Python 2.7.x
  • Amazon Product Advertising account (for APIAccessKey, APISecretKey)
  • AWS account (for AmazonAssociateTag)
$ pip install -r requirements.txt

Description

Choose 2 regions for endpoints, primary and secondary. If specified book information was not found in primary region, instead of that, this module will automatically get the information from secondary region. Of course, you can't necessarily get the information you want.

Preparation for test

set environment variable APIAccessKey, APISecretKey, AssocTag.

$ AMAZON_ACCESS_KEY = "APIAccessKey"
$ AMAZON_SECRET_KEY = "APISecretKey"
$ AMAZON_ASSOC_TAG = "AssocTag"

or create test_settings.py

$ vim test_settings.py
AMAZON_ACCESS_KEY = "APIAccessKey"
AMAZON_SECRET_KEY = "APISecretKey"
AMAZON_ASSOC_TAG = "AssocTag"

If you didn't do above both of the above settings, you should pass those variables when you instantiate AmazonBook class. In the case of you imported this module, you have got to pass variables to AmazonBook constructor.

Usage

You can set primary and secondary regions from ["US", "FR", "CN", "UK", "IN", "CA", "DE", "JP", "IT", "ES"] in instantiation. (default regions are "JP" and "US")

>>> from amabako import AmazonBook, is_isbn_validate
>>> a = AmazonBook(access_key, secret_key, assoc_tag)

>>> isbn = "9784048816592"
>>> print is_isbn_validate(isbn)
False

>>> isbn = "9781433551666"
>>> print is_isbn_validate(isbn)
True

>>> book = a.lookup(isbn, IdType="ISBN", SearchIndex="Books")

>>> print book.title
Holy Bible: English Standard Version, Value Compact Bible, Trutone Turquoise, Emblem Design

>>> print book.large_image_url
http://ecx.images-amazon.com/images/I/412mbT1AvIL.jpg

>>> print book.get_attribute('Publisher')
Crossway Books

>>> print book.price_and_currency
('1531', 'JPY')

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc