Skip to main content

Catcher

Guide to using Catcher Python script.

Catcher.py Usage and Installation Guide

Usage cases

              This script automates the metadata process using the CONTENTdm Catcher software. Given a metadata in the TSV (tab-separated values) format, the script will Add, Edit, and/or Delete the specified metadata to/from the system. Editing and deleting requires an ID tag sometimes referred to as a DMRECORD which can be retrieved from the URL (look for the “CISOPTR=” tag) of the article to be edited.

Software Requirements

  • Python 3.6.x+. The latest package, 3.9.2, is available for download from: https://www.python.org/downloads/release/python-392/
  • A copy of the Catcher script available from: https://github.com/pdoehle/catcher
  • Git:
    • For Windows users, there are a few options, but the simplest of these is installing the git binary from the official git-scm webpage detailed in the Software Installation section. 
    • For macOS users, a git binary from the official git-scm webpage will also be used, which is detailed in the Software Installation section. 

Software Installation

To retrieve the Catcher script, open a Command Prompt and type:

git clone

Instructions and Usage

First time usage:

              If the script does not detect a “.env” file in the same directory, it will ask the user if they would like to create one. This is a plain text file that stores the user’s username, password, and license for autologin, so note that if the machine is public, this option may cause security issues. 

  • Enter the collection you would like to edit (case sensitive):
    • This prompt allows the user to specify the collection to edit.
    • If the user mistypes or enters a collection that does not exist, then a traceback KeyError will occur and cause the script to exit.
  • Enter location to metadata file:
    • This prompt allows the user to specify the path to the metadata file. This file should be in the same directory as the script.
    • If the user mistypes or enters a file that does not exist, then a traceback KeyError will occur and cause the script to exit.

After the metadata file has successfully been uploaded, a CSV file will be initiated if one does not exist and the transaction ID, date of the transaction, and original file will be added. 

Troubleshooting

              ModuleNotFoundError: No module named 'suds': If the user encounters this error, they need to uninstall, remove, and purge all official and unofficial branches of the ‘suds’ python module from their environment and reinstall the ‘suds-py3’ module. For more information on uninstalling python modules, visit: servicedesk.mtu.edu

              File “~/lib/python3.X/site-packages/xmltodict.py”, line 327, in parse parser.Parse error: If the user encounters this error, it is most likely from running Catcher with “python” instead of “python3”, as the xmltodict module only works with python 3. 

Further Documentation and Information

              For further documentation and information about the Catcher script, visit the official Catcher script GitHub Repository at https://github.com/pdoehle/catcher.