Skip to content

Support for new Metadata API endpoints (June 2025)

Latest

Choose a tag to compare

@charlottekostelic charlottekostelic released this 24 Jun 16:47
· 18 commits to main since this release
01389ff

BookOps-Worldcat version 1.2.0 supports changes made in the June 2025 release of the OCLC WorldCat Metadata API (version 2.0).

New in bookops-worldcat version 1.2

  • Support for /worldcat/manage/institution-config/branch-shelving-locations, /worldcat/manage/institution/holdings/move and /worldcat/search/institution endpoints
    • Move an institution's holdings and all associated local holdings records (LHR) and local bibliographic data (LBD) records from one bibliographic record to another.
    • Given an institution's Registry ID or OCLC Symbol, retrieve the associated Registry IDs and OCLC Symbols.
  • Python 3.8 is no longer supported (see Status of Python Versions for more information on current support for different versions of Python)

Changelog

Added

  • Added support for new new Metadata API functionality:
    • MetadataSession.branch_holding_codes_get() allows users to retrieve branch holding codes and shelving locations using the /worldcat/manage/institution-config/branch-shelving-locations endpoint
    • MetadataSession.institution_identifiers_get() allows users to retrieve retrieve the Registry ID and OCLC Symbols for one or more institutions using the /worldcat/search/institution endpoint
    • MetadataSession.holdings_move() allows users to move holdings and all associated LHR and LBD records from one bib record to another using the /worldcat/manage/institution/holdings/move endpoint
  • Added verify_ids function in utils.py to check OCLC Symbols and Registry IDs before passing values to API
  • GitHub Actions workflows to publish new versions to PyPI (publish.yaml) and deploy docs to bookops-cat.github.io/bookops-worldcat/ (deploy-docs.yaml) when a new release is published

Changed

  • restructured pyproject.toml following the changes implemented with poetry 2.0. Several sections of the pyproject.toml file have been moved from the tool.poetry section to the project section.
    • The project section now includes name, version, description, authors, license, keywords, dynamic (a list of sections with dynamic metadata), dependencies, requires-python, and readme.
      • dev dependencies are still in the tool.poetry.group.dev.dependencies section
    • The tool.poetry section now includes:, package-mode, exclude, packages, and classifiers
      • classifiers is defined as having dynamic metadata in the project section
    • The tool.poetry.urls section is now the project.urls section and includes other urls previously included in the tool.poetry section (ie. repository and homepage).
  • updated dependencies:
    • requests (2.32.4)
    • coverage (7.9.1)
    • pytest (8.4.0)
    • pytest-cov (6.2.1)
    • urllib3 (2.5.0)
    • made types-requests a required dependency
  • updated tool.pytest.ini_options section to include coverage options
  • updated tool.coverage.run to omit tests and docs paths from coverage report

Fixed

  • Tests in webtests/test_api_spec.py that were failing due to new endpoints that were added in June 2025.
  • type annotations for timeout arg inMetadataSession, Query, WorldcatAccessToken and WorldcatSession classes. The timeout arg now takes None, an int, a float, or a tuple containing a combination of int and float objects
  • type annotations for record arg in holdings_set_with_bib, holdings_unset_with_bib, lbd_create, lbd_replace, lhr_create, and lhr_replace. The record arg now takes a str, a bytes object, or a BinaryIO object like other methods that take a MARC record as an arg.

Removed

  • Support for python 3.8.
    • Removed all Dict, List, and Tuple imports from typing module as they are no longer necessary as of python 3.9
  • pytest-mock as a dev dependency as it was unused.