Module isbn :: Class Amazon
[hide private]
[frames] | no frames]

Class Amazon

source code

object --+    
         |    
       SRU --+
             |
            Amazon

Fetch bookinformation from Amazon using ecs. See http://aws.amazon.com/

It depends on the aws querysigner code from http://sowacs.appspot.com/AWS/

An instance of Amazon may on success hold the following keys in its result variable:

Instance Methods [hide private]
 
__init__(self, AWSId=None, AWSKey=None, endpoint='ecs.amazonaws.co.uk', uri='/onca/xml')
Returns: an SRU instance.
source code
 
fetch(self, isbn)
Retrieve information about a book based on isbn number.
source code

Inherited from SRU: getName, retrieve

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, AWSId=None, AWSKey=None, endpoint='ecs.amazonaws.co.uk', uri='/onca/xml')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • AWSId (string.) - an Amazon AWS Id.
  • AWSKey (string.) - an Amazon AWS Key.
  • endpoint (string.) - fully qualified domain name of ecs server. defaults to uk but .com may be appropriate as well.
  • uri (string.

    Note: if AWSId is None, the id and key are set from the globally saved variables. This makes it possible not to use keys in the code but read them from a config file with config().

    Example:

       import isbn
       isbn.config('keys.ini')
       a=isbn.Amazon()
       print a.result
    
    ) - path to service.
Returns:
an SRU instance.
Overrides: object.__init__

fetch(self, isbn)

source code 

Retrieve information about a book based on isbn number.

Parameters:
  • isbn - an isbn-10 or isbn-13 number.
Returns:
nothing, result is stored in result.
Raises:
  • SRUError - if no result could be retrieved.
Overrides: SRU.fetch
(inherited documentation)