A collection of scripts for working with Alma. This repository is maintained by the Automation, Indexing, and Metadata department.
aim sms send
This script sends sms messages with the twilio API that are deposited by alma into the SFTP server
aim student_workers expire_passwords
This script expires the passwords of users in the set of student worker accounts.
aim ht set_digitizer
Triggers the "Change Physical items information job" on the digifeeds set so that Statistics Note 1 has the value "umich". This will tell Google that Umich is the digitizer of the item.
- Run the
init.sh
script. This is not a complicated script. It copies over env.example to .env, copies over a precommit hook, builds the image, and installs the gems. This script is safe to rerun at any time.
`./init.sh`
- Fill out the
.env
file with the real secrets. TheALMA_API_KEY
will be different for each subcommand. (Ex:student_workers
uses a different key thanht
.)
That's it. 🎉
docker compose run --rm app bundle exec rspec
Scripts that belong in this repository use the Alma API (or another API) or talk to the sftp server. They don't have support databases. They don't talk to a Solr.
Ideally it should be easy to split this repository into separate microservices.
The scripts should not depend on each other and should certainly not depend on
other subcommands. (ex: the scripts in the hathi_trust
folder shouldn't depend
on the script in the student_workers
folder).
Script code goes in the following directory lib/aim/CATEGORY/ACTION
.
CATEGORY
is the entity that should get an ALMA_API_KEY
. It's ok if a
CATEGORY
only has one ACTION
script.
For adding script files, follow the pattern that's used for aim student_workers expire_passwords
:
- In
lib/aim.rb
aim/student_workers
is required.
- In
lib/aim/student_workers.rb
:aim/student_workers/password_expirer
is required,- the module
AIM::StduentWorkers
is introduced - all dependecies for scripts in the
aim/student_workers
directory are required
spec/aim/student_workers/password_expirer_spec.rb
has the tests associated with the script.spec/fixtures/student_workers/
has the fixture files associated with the tests for the script.- In
lib/aim/cli.rb
:- There's an
AIM::CLI::StduentWorkers
class that has anexpire_passwords
method. - there's a
student_workers
subcommand defined.
- There's an