A Reusable Pattern for Scheduled Python/SQL/API Jobs

Program Title: A Reusable Pattern for Scheduled Python/SQL/API Jobs
ILS: Sierra
Program Description: Goals of this presentation:

  1. To encourage those who have not begun to automate their SQL queries or leverage the REST API to take the plunge.
  2. To lay out the structure of files and folders which simplify the creation of new scheduled jobs to update Sierra and/or generate custom reports.

The cron/bash/Python/SQL/API scripts in use at Stark Library for the past 2 years will be discussed. It will not be a deeply technical how-to, as there is Jason Boland’s excellent weeklong course on the topic. The following will be discussed:

  • These programs share a usually concise common structure, permitting the coder to copy/paste earlier programs, make a few changes and accomplish a very different task without having to remember how every little piece works.
  • A variety of different tasks can be performed; some of these Python scripts are updating Sierra while others are simply producing reports. Some rely on SQL to define the task while others read input from a text file. Some send the results as email while others record their activities to a log file for later review. Or both.
  • There exists a CircActive caveat when updating patron records via the API. This was an expensive lesson to learn, but it can be avoided and I will describe how.
  • Time permitting, a currently-active job will be used as the template for a brand new job, edited and implemented.


Members may have seen a shorter version of this same presentation during the IUG East Virtual Conference in November 2022.
Although bash is mentioned above, I believe Windows .BAT files and PowerShell scripts would likely work as well. I simply have not tested that.

Speaker/ Information: Bob Gaydos (bgaydos@starklibrary.org) - ILS Administrator, Stark County District Library

1 Like

Reusable_Pattern.pptx (1.3 MB)