UMD Discover
From the UMD Discover Research Guide:
UMD Discover allows you to discover resources and materials in various formats in the UMD and University System of Maryland (USMAI) collections. Filters are available to refine your search by location, format, and many other criteria. If you have used UMD’s prior interface, WorldCat UMD, you will be familiar with Discover’s core features such as a single search box, and faceted limiters.
SRU
UMD Discover provides an SRU API endpoint for searching the UMD and USMAI collections. The ExLibris Developer Network provides documentation on how to structure SRU retrieval queries.
Endpoint: https://usmai-umcp.alma.exlibrisgroup.com/view/sru/01USMAI_UMCP
curl "https://usmai-umcp.alma.exlibrisgroup.com/view/sru/01USMAI_UMCP?version=1.2&operation=explain"
curl "https://usmai-umcp.alma.exlibrisgroup.com/view/sru/01USMAI_UMCP?version=1.2&operation=searchRetrieve&query=alma.all_for_ui=%22libraries%22&recordSchema=dc"Example: umddiscover-sru.py
#!/usr/bin/env python3
import urllib.request
from xml.etree import ElementTree
# Search UMD Discover via SRU
ENDPOINT = 'https://usmai-umcp.alma.exlibrisgroup.com/view/sru/01USMAI_UMCP'
# Build the URL
params = {
"version": "1.2",
"operation": "searchRetrieve",
"query": "alma.all_for_ui=\"libraries\"",
"recordSchema": "dc",
}
search_url = ENDPOINT + '?' + urllib.parse.urlencode(params)
print('\n========================')
print(f'Search URL: {search_url}')
# Get search results as parsed XML
with urllib.request.urlopen(search_url) as request:
response = ElementTree.parse(request).getroot()
NAMESPACES = {
'srw': 'http://www.loc.gov/zing/srw/',
'srw_dc': 'info:srw/schema/1/dc-schema',
'dc': 'http://purl.org/dc/elements/1.1/',
}
# Iterate over the returned items
for record in response.find('srw:records', NAMESPACES):
dc = record.find('srw:recordData', NAMESPACES).find('srw_dc:dc', NAMESPACES)
# Extract Item information
title = dc.find('dc:title', NAMESPACES).text
contributor = "; ".join([c.text for c in dc.findall('dc:contributor', NAMESPACES)])
print('----')
print(f'Title: {title}')
print(f'Contributor: {contributor}')
You can also use the sru-queryer Python package to build your query to the SRU endpoint. See Working with Bib data – using SRU made easier!.
Example: umddiscover-sru-queryer.py