Directory API Wrapper

This documentation explains the methods of the Directory object. For the specific fields on the objects returned by these methods, see the official documentation.

class penn.directory.Directory(bearer, token)[source]

The client for the Directory. Used to make requests to the API.

Parameters:
  • bearer – The user code for the API
  • token – The password code for the API

Usage:

>>> from penn import Directory
>>> d = Directory('MY_USERNAME_TOKEN', 'MY_PASSWORD_TOKEN')

Get a detailed list of person objects for the given search params.

Parameters:params – Dictionary specifying the query parameters
>>> people_detailed = d.detail_search({'first_name': 'tobias', 'last_name': 'funke'})
person_details(person_id, standardize=False)[source]

Get a detailed person object

Parameters:person_id – String corresponding to the person’s id.
>>> instructor = d.person('jhs878sfd03b38b0d463b16320b5e438')
search(params, standardize=False)[source]

Get a list of person objects for the given search params.

Parameters:
  • params – Dictionary specifying the query parameters
  • standardize – Whether to standardize names and other features, currently disabled for backwards compatibility. Currently standardizes names, lowercases emails, and removes faculty label from affiliation.
>>> people = d.search({'first_name': 'tobias', 'last_name': 'funke'})