`Person` cannot handle "Contacts"
It's possible to enter "contacts" to IAM, e.g. to add external people to a mailinglist. Person.get_person
currently fails for these (because they miss some fields). One such example is "laura.suarez@lsce.ipsl.fr". Is there a way to read those? In any case I wrote a small snipped to achieve this. (Just FYI.)
from dataclasses import dataclass
import ethz_iam_webservice
e = ethz_iam_webservice.login(IAM_USERNAME, IAM_PASSWORD)
@dataclass
class Contact:
mail: str
firstname: str
lastname: str
@classmethod
def from_data(cls, data):
return cls(data["mail"][0], data["firstname"], data["lastname"])
@classmethod
def get_contact(cls, identifier):
data = e.person.get_request(f"/users/{identifier}")
return cls.from_data(data)