Closed HXyL229ZI0gk5u closed 5 months ago
Putting in brackets and making a list seems to return the output as expected:
response = session.holdings_get_current(oclcNumbers=[123456789])
@HXyL229ZI0gk5u, thank you! We will include a fix in 1.0.1 to allow a single int
to be passed as an arg to holdings_get_current
and bib_get_current_oclc_number
.
I find that the holdings_get_current sample code (https://bookops-cat.github.io/bookops-worldcat/latest/manage_holdings/) only returns the following error, unless the OCLC number is enclosed in quotes:
Traceback (most recent call last): File "C:\Users\tosaka\PycharmProjects\DataSync2\main.py", line 20, in
response = session.holdings_get_current(oclcNumbers=123456789)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tosaka\Anaconda3\envs\pythonProject\Lib\site-packages\bookops_worldcat\metadata_api.py", line 879, in holdings_get_current
vetted_numbers = verify_oclc_numbers(oclcNumbers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tosaka\Anaconda3\envs\pythonProject\Lib\site-packages\bookops_worldcat\utils.py", line 84, in verify_oclc_numbers
raise InvalidOclcNumber(
bookops_worldcat.errors.InvalidOclcNumber: Argument 'oclcNumbers' must be a list or comma separated string of valid OCLC #s.