Repository navigation
Support for new Metadata API 2.0 release
BookOps-Worldcat version 1.1.0 supports changes made in the September 2024 release of the OCLC WorldCat Metadata API (version 2.0).
New functionality in 1.1
- retrieve full MARC records in JSON format
- remove associated Local Holdings Records (LHRs) and Local Bibliographic Data records (LBDs) when unsetting holdings on a WorldCat record
Changelog
Added
- Support for new Metadata API functionality:
bib_searchmethod withinMetadataSessionclass allows users to retrieve full MARC records in JSON format with the new/worldcat/search/bibs/{oclcNumber}cascadeDeletearg added toholdings_unsetandholdings_unset_with_bibmethods. LHR and LBD records will be deleted when unsetting holdings on a record in WorldCat. This default functionality can be changed by settingcascadeDeletetoFalse
- Monthly live tests running via GitHub Actions
- Tests will check whether changes have been made to the Metadata API
- Python 3.13 added to unit tests
- Type annotations added to fixtures in
conftest.py scopeadded as a return value inWorldcatAccessTokentests and documentation- OCLC's Authorization Server now accepts and returns
scopeas a parameter but it appears to be interchangeable withscopes. It is listed in the tests and documentation forWorldcatAccessTokenbut is not included as an attribute for the class.
- OCLC's Authorization Server now accepts and returns
- Dev dependencies:
types-pyyaml(6.0.12)
Changed
- Moved live tests to separate files within
tests/webtestsdirectory - Moved fixtures for live tests to
tests/webtests/conftest.py - Minor edits to tests due to changes in responses from Metadata API
- Updated dependencies:
certifi(2024.8.30)charset-normalizer(3.4.0)idna(3.10)requests(2.32.3)urllib3(2.2.3)
- Updated dev dependencies:
babel(2.16.0)black(24.8.0)coverage(7.6.1)exceptiongroup(1.2.2)griffe(1.4.0)importlib-metadata(8.5.0)importlib-resources(6.4.5)jinja2(3.1.4)markdown(3.7)mike(2.1.3)mkdocs-autorefs(1.2.0)mkdocs-get-deps(0.2.0)mkdocs-material(9.5.46)mkdocs(1.6.1)mkdocstrings-python(1.11.1)mkdocstrings(0.26.1)mypy(1.13.0)packaging(24.2)paginate(0.5.7)platformdirs(4.3.6)pluggy(1.5.0)pygments(2.18.0)pymdown-extensions(10.12)pyparsing(3.1.4)pytest-mock(3.14.0)python-dateutil(2.9.0.post0)pytz(2024.2)pyyaml(6.0.2)regex(2024.11.6)tomli(2.1.0)types-requests(2.32.0.20241016)typing-extensions(4.12.2)urllib3(2.2.3)watchdog(4.0.2)wheel(0.45.1)zipp(3.20.2)
Fixed
- Return type for all
MetadataSessionmethods is nowrequests.ResponsenotOptional[requests.Response] - Typos and incorrect import statements
Removed
- Redundant/unused fixtures for mock 400 and 409 responses from
conftest.py - Changed
stub_marc21fixture to returnbytesand removedtest.mrcfile