Skip to main content

OCLC WorldCat Search and Metadata APIs wrapper

Project description

Build Status Coverage Status PyPI version PyPI - Python Version Code style: black License: MIT

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bookops-worldcat-0.2.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

bookops_worldcat-0.2.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file bookops-worldcat-0.2.0.tar.gz.

File metadata

  • Download URL: bookops-worldcat-0.2.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.3 Windows/10

File hashes

Hashes for bookops-worldcat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bfa7198a628c034e4d6d2f6748241a56900320a642775c4bc853720d1be9fccb
MD5 a35b352b440df05bbc36c22f1858ca5f
BLAKE2b-256 a85e2f8078e16f0ff14fd305e2c8cacd239f296e479f498c859b7ec49bf88f41

See more details on using hashes here.

File details

Details for the file bookops_worldcat-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bookops_worldcat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14c0ebed6917b4a93e02066bb36e9974e886f6b4f52d26cf9f98248fa3095f45
MD5 c78bb40a68ee0036c6658c3a01a3436e
BLAKE2b-256 9645c05f3e58cc549415c0d39b82b5d1aac6d7b9bac4b84b88f87d87aa6113d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page