A centralized collection of R functions designed to streamline CSD data workflows, data analysis, and dashboard development.
get_oclc_token(): Fetches a new OCLC access token for specified APIs (WorldCat Metadata/Search).ensure_valid_token(): Checks token expiration and auto-refreshes if necessary.
enrich_lc_classification(): Hits the WorldCat Metadata APIclassification-bibsendpoint to retrieve the most frequent LC call number for a given OCLC list.enrich_uc_overlap(): Uses the WorldCat Search API to identify UC-wide holdings. Returns a pipe-separated list of UC institutions holding the item.enrich_total_holdings(): Retrieves the worldwide holding count for OCLC numbers via thebibs-holdingsendpoint.enrich_selectors(): Joins LC call numbers against a master Google Sheet lookup table to assign Selectors and Roles.enrich_vernacular_title(): Cleans MARC Local Param columns (field 880). It strips$$6prefixes and removes$$b(subtitle) or$$cmarkers to return a readable vernacular title.
This library requires an .Renviron file to store sensitive API credentials and other details.
💡 Note: See
.Renviron.examplein this repository for the required naming conventions and structure.
library(httr2)
library(dplyr)
library(purrr)
library(stringr) #only needed if using enrich_vernacular_title()
library(googlesheets4) #only needed if using enrich_selectors()
source("csd_function_library.R")- ILL Borrowing Data Dashboard: Interlibrary loan analytics
- Selector Assignment Tool: Batch call number to selector matching
- UC Overlap Tool: Selective & Batch checking of OCLC Numbers for UC Overlap
AI Disclosure: Large language models (LLMs) were used to assist in writing, troubleshooting, and documenting the contents of this repository. All outputs were reviewed and validated by the developer.