3.1.2.1.4. ldap.utils – Processing for LDAP-Like Person Listings

A set of shared utilities useful for dealing with LDAP or LDAP-like data sources. Contains a list of LDAP-entry defined fields and a partial processor for LDAP data.

lib.tasks.phonebook.ldap.utils.supported_fields

A set of fields supported by the process_data() function.

address (__builtin__.str)
The person’s home address (or if that’s not available, their first available physical address).
affiliation (__builtin__.str)
Described here. As of writing, possible values include “faculty”, “staff”, “student”, and “member”.
birth_date (datetime.date)
An instance of datetime.date representing the person’s date of birth.
department_number (__builtin__.str)
A code representing what department this person belongs to.
email (__builtin__.str)
The person’s email address.
employee_number (__builtin__.str)
If this person is employed by the University of Florida, this is their employee number. This is the same as one’s UFID Number.
gatorlink (__builtin__.str)
The person’s gatorlink username.
gatorlink_email (__builtin__.str)
The person’s gatorlink email address (if not explicitly provided, this is guessed to be the person’s gatorlink, with “@ufl.edu” appended onto the end).
language (__builtin__.str)
The person’s prefered language.
name (__builtin__.str)
The person’s name, typically: “Lastname, Firstname”
office_address (__builtin__.str)
The person’s office address (if available).
phone (__builtin__.str)
The preferred phone number (or at least the first one that shows up
preferred_phone (__builtin__.str)
An alias to phone.
raw_ldap (__builtin__.dict)
The raw fields pulled from the person’s LDAP entry.
title (__builtin__.str)
Usually something like “student”, or “Resident, DN-ORAL SURGERY RESIDENT”
lib.tasks.phonebook.ldap.utils.process_data(data)

Takes a dict or list of tuples with “raw” LDAP data in string format, and processes it into more pythonic objects with keys matching those listed in supported_fields. The processed dict is returned.