1
2
3 """
4 Querying the Library of Congress for bibliographic information.
5 """
6
7
8 __docformat__ = 'restructuredtext en'
9
10
11
12
13 from basewebquery import BaseWebquery
14 import querythrottle
15
16
17
18
19 LOC_ROOTURL = \
20 'http://z3950.loc.gov:7090/voyager?operation=searchRetrieve&version=1.1'
21
22
23
24
26
27 - def __init__ (self, timeout=5.0, limits=None):
34
36 """
37 Return the metadata for a publication specified by ISBN.
38 """
39 format = lower (format)
40 assert (format in ['mods', 'opacxml', 'dc', 'marcxml'])
41 sub_url = '&recordSchema=%(format)s&startRecord=1&maximumRecords=5&' \
42 'query=bath.standardIdentifier=%(isbn)s' % {
43 'isbn': isbn,
44 'format': format,
45 }
46 return self.query (sub_url)
47
48
49
50
51
52
54 import doctest
55 doctest.testmod()
56
57
58
59
60 if __name__ == '__main__':
61 _doctest()
62
63
64
65