All Projects → BookOps-CAT → bookops-worldcat

BookOps-CAT / bookops-worldcat

Licence: MIT license
BookOps WorldCat Metadata API wrapper

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to bookops-worldcat

cvpysdk
Developer SDK - Python
Stars: ✭ 50 (+138.1%)
Mutual labels:  api-wrapper
ruby-ambassador
Ambassador API v2 wrapper for Ruby
Stars: ✭ 20 (-4.76%)
Mutual labels:  api-wrapper
libdrizzle-redux
The next generation of Libdrizzle with a simplified API and support for more features of the protocol
Stars: ✭ 14 (-33.33%)
Mutual labels:  api-wrapper
hata
Async Discord API wrapper.
Stars: ✭ 156 (+642.86%)
Mutual labels:  api-wrapper
messages
A python package designed to make sending messages easy and efficient!
Stars: ✭ 38 (+80.95%)
Mutual labels:  api-wrapper
chess-web-api
Chess.com public data API wrapper with "isChanged" and priority queue functionality.
Stars: ✭ 83 (+295.24%)
Mutual labels:  api-wrapper
Notion Api
Unofficial Notion.so API
Stars: ✭ 250 (+1090.48%)
Mutual labels:  api-wrapper
valorant.py
Complete Python interface for the Valorant API. Works right out of the box!
Stars: ✭ 84 (+300%)
Mutual labels:  api-wrapper
wikipedia-reference-scraper
Wikipedia API wrapper for references
Stars: ✭ 34 (+61.9%)
Mutual labels:  api-wrapper
newsapi-php
A PHP client for the News API (https://newsapi.org/docs/get-started)
Stars: ✭ 21 (+0%)
Mutual labels:  api-wrapper
libbib
An R package providing WorldCat API communication, functions for validating and normalizing bibliographic codes, translation from call numbers to subject, and other related utilities helpful for assessment librarians
Stars: ✭ 21 (+0%)
Mutual labels:  worldcat
cpAPI
A Flask API that gives updates about the upcoming contests on various Coding Platforms.
Stars: ✭ 13 (-38.1%)
Mutual labels:  api-wrapper
epicstore api
Epic Games Store Web API Wrapper written in Python
Stars: ✭ 48 (+128.57%)
Mutual labels:  api-wrapper
java-binance-api
Java Binance API Client
Stars: ✭ 72 (+242.86%)
Mutual labels:  api-wrapper
AniList-Node
A lightweight Node.js wrapper for the AniList API
Stars: ✭ 36 (+71.43%)
Mutual labels:  api-wrapper
conekta-elixir
Elixir library for Conekta api calls
Stars: ✭ 15 (-28.57%)
Mutual labels:  api-wrapper
powershellwrapper
This PowerShell module acts as a wrapper for the IT Glue API.
Stars: ✭ 96 (+357.14%)
Mutual labels:  api-wrapper
cf-mailchimp
ColdFusion wrapper for the MailChimp 3.0 API
Stars: ✭ 17 (-19.05%)
Mutual labels:  api-wrapper
pjbank-js-sdk
PJBank SDK para Javascript! ⚡ ⚡ ⚡
Stars: ✭ 24 (+14.29%)
Mutual labels:  api-wrapper
Pyrez
(ON REWRITE) An easy to use (a)sync wrapper for Hi-Rez Studios API (Paladins, Realm Royale, and Smite), written in Python. 🐍
Stars: ✭ 23 (+9.52%)
Mutual labels:  api-wrapper

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

bookops-worldcat

Early ALPHA version

BookOps-Worldcat provides a Python interface for the WorldCat Metadata API. This wrapper simplifies requests to OCLC web services making them ideally more accessible to OCLC member libraries.

Due to major changes introduced by OCLC in May 2020, the version 0.3.0 of the wrapper dropped functionality related to WorldCat Search API. New search endopoints of the Metadata API supported in the 0.3.0 version should fill that gap. While WorldCat Metadata API is our primary focus, we plan in the future to expand wrapper's functionality to other related OCLC web services, including the now dropped Search API.

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 the functionality of the popular Requests library. Interactions with OCLC's services are built around 'Requests' sessions. Authorizing a web service session simply requires passing an access token to MetadataSession. Opening a session allows the user to call specific methods to facilitate communication between the user's script/client and particular endpoint of OCLC API 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 endpoints of the Metadata API are implemented at the moment. This tool was primarily built for the specific needs of BookOps but we are open to 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 Metadata API
    • Metadata API Search Functionality
      • member shared print holdings
      • member general holdings
      • searching bibliographic resources:
        • search brief bibs
        • retrieve specific brief bib
        • retrieve other editions related to a specific bibliographic resource
    • Metadata API
      • bibliographic records
        • retrieve full bib
        • find current OCLC number
      • holdings
        • set institution holding for a single resource
        • unset institution holding for a single resource
        • retrieve holding status of a single resource
        • set institution holdings for a batch of resources
        • unset institution holdings for a batch of resouces
        • set holdings for a single resource for multiple institutions
        • unset holdings for a single resource for multiple institutions

Basic usage:

Obtaining access token

>>> from bookops_worldcat import WorldcatAccessToken
>>> token = WorldcatAccessToken(
    key="my_WSkey",
    secret="my_WSsecret",
    scopes="selected_scope",
    principal_id="my_principalID",
    principal_idns="my_principalIDNS",
    agent="my_client"
  )
>>> print(token.token_str)
  "tk_Yebz4BpEp9dAsghA7KpWx6dYD1OZKWBlHjqW"

Metadata API

>>> from bookops_worldcat import MetadataSession
>>> session = MetadataSession(authorization=token)
>>> result = session.get_brief_bib(oclcNumber=1143317889)
>>> print(result)
  <Response [200]>
>>> print(result.json())
{
  "oclcNumber": "1143317889",
  "title": "Blueprint : the evolutionary origins of a good society",
  "creator": "Nicholas A. Christakis",
  "date": "2020",
  "language": "eng",
  "generalFormat": "Book",
  "specificFormat": "PrintBook",
  "edition": "First Little, Brown Spark trade paperback edition.",
  "publisher": "Little, Brown Spark",
  "catalogingInfo": {
    "catalogingAgency": "NYP",
    "transcribingAgency": "NYP"
  }
}

Using a context manager:

with MetadataSession(authorization=token) as session:
    results = session.get_full_bib(1143317889)
    print(results.text)
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <content type="application/xml">
    <response xmlns="http://worldcat.org/rb" mimeType="application/vnd.oclc.marc21+xml">
      <record xmlns="http://www.loc.gov/MARC21/slim">
        <leader>00000cam a2200000 i 4500</leader>
        <controlfield tag="001">on1143317889</controlfield>
        <controlfield tag="003">OCoLC</controlfield>
        <controlfield tag="005">20200328101446.1</controlfield>
        <controlfield tag="008">200305t20202019nyuabf   b    001 0 eng c</controlfield>
        <datafield tag="010" ind1=" " ind2=" ">
          <subfield code="a">  2018957420</subfield>
    </datafield>
        <datafield tag="040" ind1=" " ind2=" ">
          <subfield code="a">NYP</subfield>
          <subfield code="b">eng</subfield>
          <subfield code="e">rda</subfield>
          <subfield code="c">NYP</subfield>
<!--...-->
        <datafield tag="020" ind1=" " ind2=" ">
          <subfield code="a">9780316230049</subfield>
          <subfield code="q">(pbk.)</subfield>
<!--...-->
        <datafield tag="100" ind1="1" ind2=" ">
          <subfield code="a">Christakis, Nicholas A.,</subfield>
          <subfield code="e">author.</subfield>
    </datafield>
        <datafield tag="245" ind1="1" ind2="0">
          <subfield code="a">Blueprint :</subfield>
          <subfield code="b">the evolutionary origins of a good society /</subfield>
          <subfield code="c">Nicholas A. Christakis.</subfield>
    </datafield>
        <datafield tag="250" ind1=" " ind2=" ">
          <subfield code="a">First Little, Brown Spark trade paperback edition.</subfield>
    </datafield>
        <datafield tag="264" ind1=" " ind2="1">
          <subfield code="a">New York, NY :</subfield>
          <subfield code="b">Little, Brown Spark,</subfield>
          <subfield code="c">2020</subfield>
    </datafield>
<!--...-->
  </record>
    </response>
  </content>
  <id>http://worldcat.org/oclc/1143317889</id>
  <link href="http://worldcat.org/oclc/1143317889"></link>
</entry>

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.

Todo

  • Metadata API:
    • support for local holdings resources endpoints of the search functionality of the Metadata API
    • support for local bibliographic data endpoints
    • record validation endpoints
    • methods to create and update bibliographic records
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].