OCLC WorldCat Search and Metadata APIs wrapper
Project description
bookops-worldcat
Early ALPHA version
A WorldCat Search and Metadata APIs wrapper abstracting OCLC's boilerplate.
BookOps-Worldcat simplifies requests to these web services making them more accessible to OCLC member libraries.
Installation
Use pip:
$ pip install bookops-worldcat
Documentation
For full documentation please see https://bookops-cat.github.io/bookops-worldcat/
Features
This package takes advantage of functionality of a popular Requests library. Interactions with OCLC's services are built around Requests' sessions. Authorizing a session simply requires passing OCLC's WSkey (SearchSession
) or an access token (MetadataSession
). Opening a session allows the user to call specific methods to facilitate communication between the user's script/client and a particular endpoint of OCLC's service. Many of the hurdles related to making valid requests are hidden under the hood of this package, making it as simple as possible.
Please note, not all functionalities of Worldcat Search and Metadata APIs are implemented as this tool was built primarily for the BookOps organization's specific needs. We are open to any collaboration to expand and improve this package.
At the moment, BookOps-Worldcat supports requests to following OCLC's web services:
- Authentication via Client Credential Grant
- WorldCat Search API
- SRU
- Read
- Lookup By ISBN
- Lookup By ISSN
- Lookup By Standard Number
- Worldcat Metadata API
- Read
- Set/Create
- Unset/Delete
- Retrieve Status
- Batch Set
- Batch Unset
Basic usage:
>>> from bookops_worldcat import SearchSession
>>> session = SearchSession(credentials="your_WSkey")
>>> result = session.lookup_oclc_number("1143317889")
>>> print(result)
<Response [200]>
Context manager:
with SearchSession(credentials="your_WSkey") as session:
results = session.lookup_isbn("9781680502404")
print(results.text)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<record xmlns="http://www.loc.gov/MARC21/slim">
<leader>00000cam a2200000 i 4500</leader>
<controlfield tag="001">1143317889</controlfield>
<controlfield tag="008">200305t20202019nyuabf b 001 0 eng c</controlfield>
<datafield ind1=" " ind2=" " tag="010">
<subfield code="a"> 2018957420</subfield>
</datafield>
<datafield ind1=" " ind2=" " tag="020">
<subfield code="a">9780316230049</subfield>
<subfield code="q">(pbk.)</subfield>
</datafield>
<datafield ind1=" " ind2=" " tag="020">
<subfield code="a">0316230049</subfield>
</datafield>
<datafield ind1="1" ind2=" " tag="100">
<subfield code="a">Christakis, Nicholas A.,</subfield>
<subfield code="e">author.</subfield>
</datafield>
<datafield ind1="1" ind2="0" tag="245">
<subfield code="a">Blueprint :</subfield>
<subfield code="b">the evolutionary origins of a good society /</subfield>
<subfield code="c">Nicholas A. Christakis.</subfield>
</datafield>
...
</record>
Changelog
Consult the Changelog page for fixes and enhancements of each version.
Bugs/Requests
Please use Github issue tracker to submit bugs or request features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bookops_worldcat-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14c0ebed6917b4a93e02066bb36e9974e886f6b4f52d26cf9f98248fa3095f45 |
|
MD5 | c78bb40a68ee0036c6658c3a01a3436e |
|
BLAKE2b-256 | 9645c05f3e58cc549415c0d39b82b5d1aac6d7b9bac4b84b88f87d87aa6113d6 |