Releases: BookOps-CAT/bookops-worldcat
Releases · BookOps-CAT/bookops-worldcat
Bug fixes
Fixed
- Inconsistent default values for
timeout
arg forMetadataSession
,WorldcatAccessToken
andQuery
objects
Changed
- Updated dev dependencies:
- black (24.3.0)
- Updated dependencies:
- idna (3.7)
- Reformatted docstrings for better readability on https://bookops-cat.github.io/bookops-worldcat/
- Fixed typos
prep_oclc_number_str
now parses OCLC Numbers with "(OCoLC)" prefix. Parsing rules match OCLC documentation
Added
- Tutorials to
tutorials.md
Bookops-Worldcat 1.0.0
Bookops-Worldcat version 1.0 supports changes released in version 2.0 (May 2023) of the OCLC Metadata API and has expanded coverage to all endpoints of the Metadata API. This version introduces many breaking changes due to the complete refactor of the Metadata API.
New functionality in 1.0
- Send requests to all endpoints of WorldCat Metadata API
- Match bib records and retrieve bib classification
- Create, update, and validate bib records
- Create, retrieve, update, and delete local bib and holdings records
- Add automatic retries to failed requests
- Authenticate and authorize for multiple institutions within
MetadataSession
- Support for Python 3.11 and 3.12
Changelog
Added
- Support for OCLC Metadata API Version 2.0
MetadataSession
methods to support new functionality released in Metadata API 2.0bib_match
bib_get_classification
holdings_set_with_bib
andholdings_unset_with_bib
- New
MetadataSession
methods to support existing Metadata API functionality- Bib Record Management and Validation
bib_create
bib_replace
bib_validate
- Local Holdings Records
lhr_create
lhr_delete
lhr_get
lhr_replace
- Local Bibliographic Data
lbd_create
lbd_delete
lbd_get
lbd_replace
- Holdings Management
holdings_get_codes
- Bib Record Management and Validation
- Support for automatic retries of failed requests
- Support for multi-institution WSKeys
- Support for Python 3.11 and 3.12
- New dev dependencies:
- types-requests (2.31.0.20240125)
- mkdocs-material (9.5.13)
Changed
MetadataSession
methods that have been renamed and updated (replacing existing functionality in Bookops-Worldcat):get_brief_bib
is nowbrief_bibs_get
get_full_bib
is nowbib_get
holding_get_status
is nowholdings_get_current
holding_set
is nowholdings_set
holding_unset
is nowholdings_unset
search_brief_bib_other_editions
is nowbrief_bibs_get_other_editions
search_brief_bibs
is nowbrief_bibs_search
search_current_control_numbers
is nowbib_get_current_oclc_number
search_general_holdings
is nowsummary_holdings_search
search_shared_print_holdings
is nowshared_print_holdings_search
WorldcatAccessToken
scopes
arg now only accepts strings. ATypeError
is raised ifscopes
arg is passed a listtoken_expires_at
attribute is now an awaredatetime
object (change made due todatetime.utcnow()
deprecation)
- Error handling:
TypeError
andValueError
replaceWorldcatAuthorizationError
whenWorldcatAccessToken
is passed an invalid arg.MetadataSession
now raisesInvalidOclcNumber
exception when invalid OCLC identifiers are given
pytest
configuration moved frompytest.ini
topyproject.toml
- Updated and clarified type annotations for
MetadataSession
methods - Updated dependencies:
- requests: (2.31)
- Updated dev dependencies:
- black (23.3.0)
- mike (2.0.0)
- mypy (1.0.14)
- Documentation on https://bookops-cat.github.io/bookops-worldcat/ has been rewritten and reorganized
Fixed
AttributeError
changed toTypeError
if arg passed toQuery.prepared_request
is not aPreparedRequest
- All args for methods within
MetadataSession
have been changed to camel case to be consisted with Metadata API documentation
Removed
principalID
andprincipalIDNS
as args forWorldcatAccessToken
- Automatic handling of large sets of oclcNumbers
_split_into_legal_volume
removed fromMetadataSession
; aValueError
is now raised if a method is passed too many oclcNumbers
Deprecated
- Support for Python 3.7
- 409 error handling for holdings set/unset requests
WorldcatSessionError
- Replaced with
TypeError
orValueError
inWorldcatSession
- Replaced with
Holdings for Mulitiple Institutions
Adds:
- methods to set and unset OCLC holdings for multiple institutions (for consortia): /ih/institutionlist endpoint
__repr__
method toWorldcatAccessToken
class- fuller response when
WorldcatRequestError
is raised that provides details returned by the service
Fixes:
- authentication server response when request to obtain an access token fails
Changed:
- test fixtures refactoring
Fixes handling of 206 HTTP code when searching
- Fixes handling of unexpected 206 HTTP code that is occasionally returned by the MetadataAPI /brief-bibs endpoint
- Refactors
metadata_api
and moves requests into a newquery.Query
class
API endpoints changes update
- Changes to
MetadataSession.search_brief_bibs
method due to /brief-bibs endpoint changes:- removed deprecated argument
heldBy
- added
groupVariantRecord
andpreferredLanuage
argument - modified
groupRelatedEditions
to allow boolean arguments
- removed deprecated argument
- Changes to
MetadataSession.search_general_holdings
method due to API changes:- added following arguements:
holdingsAllVariantRecords
,preferredLanguage
- removed deprecated
heldBy
argument
- added following arguements:
- Changes to
MetadataSession.search_brief_bib_other_editions
:- added
deweyNumber
,datePublished
,heldByGroup
,heldBySymbol
,
heldByInstitutionId
,inLanguage
,inCatalogLanguage
,materialType
,
catalogSource
,itemType
,itemSubType
,retentionCommitments
,
spProgram
,topic
,subtopic
,audience
,content
,openAccess
,
peerReviewed
,facets
,groupVariantRecords
,preferredLanguage
,
andorderBy
.
- added
urllib3 bump to 1.26.5
urllib3 dependency upgraded from 1.26.4 to 1.26.5 following vulnerability report
certifi, chardet, requests, urllib3 dependencies update
Dependencies update
- certifi to 2020.12.5
- chardet to 4.0.0
- requests to 2.25.1
- urllib3 to 1.26.4
MetadataSession timeout fix
Fixes an inactive timeout
parameter in the MetadataSession
. Every request sent within the session follows session's timeout setting.
MetadataSession auto token refresh fix
New:
- dependencies bump
- python 3.9 testing
Bug fixes:
- proper auto refreshing of stale access tokens
- error message testing fixed
support for Metadata API v.1.1
Introduces Metadata API v.1.1 changes released by OCLC in May 2020. This version breaks in major ways with previous version 0.2.0.
- Dropped features related to the WorldCat Search API (!)
- Supported Metdata API endpoints:
- /bibs-retained-holdings (new)
- /bibs-summary-holdings (new)
- /brief-bibs (new)
- /brief-bibs/{oclcNumber} (new)
- /brief-bibs/{oclcNumber}/other-editions (new)
- /bib/data/{oclcNumber}
- /bib/checkcontrolnumbers
- /ih/data (POST|DELETE)
- /ih/checkholdings
- /ih/datalist (POST|DELETE)
- API reference added to docs with mkapi