A module for requesting and parsing SRU data from Alma.
from alma.sru import client
isbn = '0738-0895'
# Build SRU request
iz_query = client.make_url(zone="IZ", query=f"alma.isbn={isbn}")
# Make SRU request
iz_query_resp = client.search(iz_query)
# Create SRU response objects
iz = client.parse(iz_query_resp, zone="IZ")
from alma.sru import client
issn = '0738-0895'
# Build SRU requests
iz_query = client.make_url(zone="IZ", query=f"alma.issn={issn}")
nz_query = client.make_url(zone="NZ", query=f"alma.issn={issn}")
# make multiple SRU requests at once
urls = [
iz_query,
nz_query,
]
(iz_query_resp,
nz_query_resp) = client.searches(urls, 2)
# create SRU response objects
iz = client.parse(iz_query_resp, zone="IZ")
nz = client.parse(nz_query_resp, zone="NZ")
The SRU client will return an SRU object that can be called to get various information about the search result.
Returns the number of records found.
Is either TRUE (no errors encountered) or FALSE (some errors encountered)
Returns any errors encountered.
Returns XML representation of SRU response.
Returns a dictionary of the SRU response.
Returns the call number.
Returns print holdings (if any) for the item as a list, else a blank list.
Is either TRUE or FALSE.
Returns e-holdings (if any) for the item as a list, else a blank list.