Take a CSV of missing syllabi VAULT report and send emails to faculty about which syllabi we expect from them. We skip notifying faculty for courses which do not require syllabi (e.g. Graduate Studio Practice) and work around problematic faculty values like "Staff" and "Standby".
Usual Python projects steps and configure a .env file with values for SMTP domain, port, user, and password (see example.env). Consult Mailgun or the Moodle outgoing mail configuration for these values.
> pipenv install
> cp reminders/example.env reminders/.env
> vim reminders/.env # edit in real values
> pipenv shell # run inside the virtual environment
> python cli.py -h # view usage information, see steps below
We also need access to the "integration files source" Google Storage Bucket. Once our CCA account has access permission, we use Application Default Credentials to allow this project access. This should be a matter of installing gcloud
and running gcloud auth application-default login
once.
pipenv shell
python cli.py -u
python cli.py -o
opens it)python reminders/status.py data/2023-01-26-Spring_2023.json data/report.csv
python cli.py data/report.csv
to send emails, use the --template
flag to specify one of:
There are pytest tests, but not much coverage. The testing utilities are written as pipenv scripts in the Pipfile.
pipenv run test # run tests
pipenv run coverage # test coverage
pipenv run report # coverage report
We can dry-run the app by setting a DEBUG
environment variable (or .env value) to True
. Run DEBUG=true python cli.py report.csv
to test the script, for instance. The DEBUG
env var can also be used to debug issues with Google Cloud authentication, e.g. DEBUG=True python reminders/update_usernames.py
.
We can use "has_syllabus.py" to count the number of rows in a CSV of courses which have syllabi:
> python reminders/has_syllabus.py data/report.csv
760 courses have syllabi of 806 total in the CSV
Report CSV should have the following columns with this exact header row
"Semester","Department Code","Course Title","Instructor(s)","Section"
Some of the columns are not used but these are the ones typically contained in the VAULT report.