bookops_worldcat.query
Handles requests to OCLC web services.
Query
Query(
session: MetadataSession,
prepared_request: PreparedRequest,
timeout: Union[
int,
float,
Tuple[int, int],
Tuple[float, float],
None,
] = (5, 5),
)
Sends a request to OCLC web service and unifies exceptions.
Query object handles automatic refresh of expired token before each
request is made to the web service. Query.response
attribute is
requests.Response
instance that can be parsed to extract information received from the web service.
PARAMETER | DESCRIPTION |
---|---|
session |
TYPE:
|
prepared_request |
TYPE:
|
timeout |
How long to wait for server to send data before giving up. Accepts separate values for connect and read timeouts or a single value.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
WorldcatRequestError
|
If the request encounters any errors. |
TypeError
|
If |
Source code in bookops_worldcat\query.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|