This script is designed to offboard UMGC employees and students in Alma. It has the following steps:
- Pull analytics report for Staff members to be offboarded
- Compare the
STAFF_USER_THRESHOLDenvironment variable to the number of staff returned. If the number of staff returned is greater than this variable, the program will assume the SIS load update of Status dates has not happened and will quit with an error message. This check prevents the accidental update of too many users in the event the SIS update of status dates has not happened. - Create an Alma set with up to 1000 staff members
- If
RUN_JOBSis true, run an Alma job to update the staff members as per UMGC offboarding practices - Pull analytics report for inactive students
- Create an Alma set with all of these students (unlimited quantity supported)
- If
RUN_JOBSis true, run an Alma job to update the students as per UMGC offboarding practices.
- This script can only offboard up to 1000 staff members at a time.
This script requires Python Version 3.10 or higher.
API_KEY: An Alma API key with 2 permissions: Analytics Read/Write, and Configuration Read/WriteSTAFF_USER_THRESHOLD: If the number of staff to offboard (as returned by the Analytics Report) is greater than this number, the program will assume the SIS load update of Status dates has not happened and will quit with an error message. This check prevents the accidental update of too many users in the event the SIS update of status dates has not happened. This will also cancel the Student offboarding.
- Create a new environment variable file called
.envin the directory root, and copy the contents of.env.exampleinto that file. - Fill in the API key and the
STAFF_USER_THRESHOLDenvironment variables. - Create a python virtual environment with the command
python3 -m venv .venv. The virtual environment will be named.venv - Activate the virtual environment with the command
source .venv/bin/activate(linux/MacOS) or.\.venv\Scripts\Activate.ps1on Windows PowerShell. - Install requirements with
pip install -r requirements.txt - You can then run the program with
python3 -m withdraw
This script can be run using a single shell line, which is useful for CRON scheduling:
source .venv/bin/activate && python3 -m withdraw