pittcsc / PittAPI

An API to easily get data from the University of Pittsburgh
https://pittapi.pittcsc.org
GNU General Public License v2.0
108 stars 33 forks source link

new people API #87

Closed dzheng256 closed 6 years ago

dzheng256 commented 6 years ago

While trying to fix the API (#85), I found that we can actually some additional information previously only available at http://find.pitt.edu (like nickname + webpage), not just what is displayed when searching using https://m.pitt.edu/people/. I originally thought this information was only accessible through LDAP, so this is great. However, the new endpoint is still missing some data available on http://find.pitt.edu like "Student Career" and "Student Plan(s)", etc. so maybe there is a better one.

I've updated people.py to get this new data and will update tests and documentation once I decide how to format the output.

For people.get_person('John Smith', 1) we can now get:

[{'kgoperson:phone': '(412)648-8362 ', 
'kgoperson:firstname': 'John', 
'ldap:nickname': 'RX2020', 
'kgoperson:email': 'jsmithjr@pitt.edu', 
'ldap:objectclass': ['person', 'top', 'PittPerson'], 
'kgo:id': 'uidNumber=3951,o=University of Pittsburgh,c=US', 
'kgo:title': 'John Smith', 
'ldap:buildingname': '250 SALK', 
'ldap:cn': 'John H Smith Jr', 
'ldap:ou': 'Pharm-Dean, Office of the', 
'ldap:l': 'Pittsburgh', 
'kgoperson:lastname': 'Smith'}]
dzheng256 commented 6 years ago

@RitwikGupta I think this is ready to be merged. I modified the output to have 1 dict per person with name and all fields inside instead of having name and then a list of fields. I think it's simpler this way.

dzheng256 commented 6 years ago

@azharichenko Any other comments? If not I'll merge.

azharichenko commented 6 years ago

Go ahead and merge it :tada: