Skip to content
/ people-api Public

programmatically interact with CCA Portal people directory

License

Notifications You must be signed in to change notification settings

cca/people-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

People API for CCA Portal

Use the "people" Elasticsearch endpoint as a public API from Portal. The Instructional Services & Technology team has a need to pull accurate lists of program administrators (faculty chairs & co-chairs, staff program managers & senior managers) complete with contact information. Portal has this data and exposes it in a machine-readable format.

Note that anyone with a private profile is excluded from the data.

Google Apps Script

This project is embedded in a spreadsheet as an apps script. It uses an "on open" trigger to add a "Refresh Data" menu to the spreadsheet, which lets us pull in data fresh from Portal. The "appscript.js" file is the source code of this program, minus the "on open" trigger which must be configured manually.

Usage

usage: app.py [-h] [-s, --staff] [--sm | --pm] [-f, --faculty]
              [-n, --no-header] [-j, --json]

Pull program chair, project manager, and studio manager information from the Portal People Directory. Writes CSV text to stdout by default.

optional arguments:
  -h, --help       show this help message and exit
  -s, --staff      whether to search staff profiles
  --sm             search staff but only for Studio Managers
  --pm             search staff but only for Project/Program Managers
  -f, --faculty    whether to search faculty profiles
  -n, --no-header  omit the CSV header row
  -j, --json       write full JSON data from Portal to stdout. Only works with
                   one of --staff or --faculty.

Examples:
  python app.py --staff --json > data/stf.json # write complete staff search JSON to file
  python app.py --pm # print only PM staff to stdout

License

ECL-2.0

About

programmatically interact with CCA Portal people directory

Resources

License

Stars

Watchers

Forks