Skip to main content

CLI tool for retrieving holding counts for a list of OCNs and libraries, simplified version

Project description

lib-holdings

Based on the https://pypi.org/project/lib-holdings/ Copyright (c) 2024 Max Paulus

Command Line Interface (CLI) tool for retrieving holding counts for a list of OCNs and institutes.

Uses the OCLC API: https://developer.api.oclc.org/

Simplied version which only uses the "wcapi"-scope

Installation

First of all, you will need to have Python installed on your computer and available on the command line. If this sounds scary, consider installing the Anaconda Navigator, an application that comes with Python and a command line.

Once installed, find and run the Anaconda Prompt which is the command line interface.

Again, knowing the command line is not a requirement. Simply copy the following into the window and press enter:

pip install lib-holdings

After the tool has been installed, continue below to learn how it works.

Usage

Preparation

Make sure you have the two input files ready:

  1. A text file (e.g. .txt) containing OCNs with 1 OCN per line
  2. A text file (e.g. .txt) containing institute symbols with 1 symbol per line

It is recommended to create a folder on your computer in which you place these input files.

Note down the path to this folder, e.g. C:/Users/username/myfolder (on Windows).

Execute the following command, replacing PATH with your path:

cd PATH

The command line now has access to that folder.

Create an empty folder (e.g. out) in which the results will be stored.

Also, keep your API key and secret handy.

Run the program

Copy and execute the following command, after replacing the indicated arguments.

(Description of the arguments can be found below)

holdings [OPTIONS] INFILE_OCNS INFILE_SYMB OUT_FOLDER

ARGUMENTS:

INFILE_OCNS:    name of the text file containing OCNs (1 per line)
INFILE_SYMB:    name of the text file containing institute symbols (1 per line)
OUT_FOLDER:     output directory

OPTIONS:

--start INTEGER  Position of OCN to start with.
--key TEXT       OCLC API key.
--secret TEXT    OCLC API secret.

Note:

The start option is handy when the program is interrupted or exits with an error. In that case, you can re-run the program, providing the start value shown.

Changes

In __main__.py

Regels 45-47: skip transform_records and merge

Lines 68: function transform_records() is no longer used.

In api.py

Line 11: removed ‘WMS_COLLECTION_MANAGEMENT’ scope.

Line 43: function extract_record_type() is no longer used

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

lib_holdings_simplified-1.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lib_holdings_simplified-1.0.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file lib_holdings_simplified-1.0.0.tar.gz.

File metadata

  • Download URL: lib_holdings_simplified-1.0.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for lib_holdings_simplified-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8a04b1dd8dda0bc4797917116829f9efd742e3c77de7df9ba4dea1c1e64b52b5
MD5 4515e626705d803df84b3b83ab2c3fab
BLAKE2b-256 9da74fb8723894075be6169ebd9a733c2ed585f7016369b99a9a9dcb173e5df4

See more details on using hashes here.

File details

Details for the file lib_holdings_simplified-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lib_holdings_simplified-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ab5ea270dc83da0372dd6246b6464b8b5e7b0713cf075e54323962bd6abd1ee
MD5 4f133a4d2078b36b36cef2508d60b16f
BLAKE2b-256 52d7e64e55a92bcbcaefecb056826f83d3c7cc4e76a1dea887b4bad893f2d4e1

See more details on using hashes here.

Supported by

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