Skip to content
/ toc Public

The «toc»-script uploads a scanned table of contents (pdf) to an ftp-server and adds an 856 field to the corresponding bibliographic record in alma with the link to the public file.

License

Notifications You must be signed in to change notification settings

rhodijn/toc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enriching Bibliographic Records in Alma with Tables of Contents

###################
##                 ##
##               ##
  ######       ##
    ##       ######
  ##               ##
##                 ##
  ###################

When a table of contents should be added to enrich a bibliographic record, this script automates the process. It uploads the pdf-file to a public server and adds a 856 field to the bibliographic record in Alma, generating a link in the discovery system.

Description

As soon as the scanned pdf-file (named barcode.pdf, where barcode is the actual barcode ot the bibliographic item) is placed in a folder on a computer or on Sharepoint, the script will upload it to a public server, rename it to mms-id.pdf (where mms-id is the NZ MMS-ID of the record) and add a field 856 to the MARC21 record in Alma.

Getting Started

Dependencies

The following python modules are required for the script to run (a requirements.txt is included):

  • argparse
  • datetime
  • dotenv
  • json
  • lxml
  • paramiko
  • os
  • re
  • smtplib
  • ssl
  • sys

Installing

  • Download all files.
  • Create empty folders named log, temp and xml in the root directory.
  • Rename the file .env.example to .env and submit your credentials inside the quotes:
API_URL=""
API_KEY=""

EMAIL_PASS=""

FTP_URL=""
FTP_USER=""
FTP_PASS=""
  • Update some values in data/config.json:
    • Update {"email": {"from": ""}} to the address which will send the enrichment report
    • Update {"email": {"to": ""}} to the address which will receive the enrichment report
    • Update {"path": {"r": ""}} to the remote path on your ftp server
    • Update {"library": {}} to keys holding the parameters you will use with the command line tool (-l or --lib) and values holding the corresponding subfolders on the remote server

Execute the script

  • This is how to run the script from the command line on MacOS (replace toc/BM2064150.pdf and winwith your values):
python3 enrich.py -f toc/BM2064150.pdf -l win
  • This is how to run the script from the command line on Windows (replace toc/BM2064150.pdf and winwith your values):
python enrich.py -f toc/BM2064150.pdf -l win
  • The relative path to the pdf-file including its name must be suplied by passing a parameter -f or --file.
  • The code for the library for the pdf-file must be suplied by passing a parameter -l or --lib.

Help

  • To show the help message on MacOS enter:
python3 enrich.py -h
  • To show the help message on Windows enter:
python enrich.py -h

If this doesn't help, feel free to contact me.

Author

This script was created by Rhodijn (zolo) for ZHAW HSB inside the 2025 CAS Data Management and Information Technologies at the University of Zurich.

Version History

  • 1.0
    • Initial Release (2025-06-17)

License

This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details.

About

The «toc»-script uploads a scanned table of contents (pdf) to an ftp-server and adds an 856 field to the corresponding bibliographic record in alma with the link to the public file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages