elm.web.rhub.ProfilesRecord

class ProfilesRecord(record)[source]

Bases: dict

Class to handle a single profiles as dictionary data. This class requires setting an ‘RHUB_API_KEY’ environment variable to access the Pure Web Service. The API key can be obtained by contacting an NREL library representative: Library@nrel.gov.

Parameters:

record (dict) – Profile in dict form, typically a response from the API.

Methods

clean_text(html_text)

Clean html text from API response

clear()

copy()

download(fp)

Download text file containing researchers profile information.

fromkeys([value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(k[,d])

If key is not found, default is returned if given, otherwise KeyError is raised

popitem()

Remove and return a (key, value) pair as a 2-tuple.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

Attributes

education

Get the education information of this researcher.

email

Get the email address of this researcher.

first_name

Get the first name of this researcher.

id

Get API ID of researcher.

last_name

Get the last name of this researcher.

position

Get the position of this researcher.

profile_information

Get key profile information for this record: Personal Profile, Research Interests, Professional Experience.

publications

Get the publications this researcher contributed to.

title

Get the full name of this researcher.

url

Get the url or this researcher's profile.

static clean_text(html_text)[source]

Clean html text from API response

Parameters:

html_text (str) – Text containing html characters.

Returns:

clean (str) – Text with html characters removed.

property first_name

Get the first name of this researcher.

Returns:

first (str) – Full name of researcher.

property last_name

Get the last name of this researcher.

Returns:

last (str) – Last name of researcher.

property title

Get the full name of this researcher.

Returns:

full (str) – Full name of researcher.

property email

Get the email address of this researcher.

Returns:

email (str) – Email address of researcher.

property url

Get the url or this researcher’s profile.

Returns:

url (str) – URL to researcher’s profile.

property id

Get API ID of researcher.

Returns:

id (str) – Researcher ID.

property position

Get the position of this researcher.

Returns:

position (str) – Researcher’s position.

property profile_information

Get key profile information for this record: Personal Profile, Research Interests, Professional Experience.

Returns:

  • bio (str) – Researcher’s profile text.

  • interests (str) – Text from Research Interests section.

  • experience (str) – Text from Professional Experience section.

property education

Get the education information of this researcher.

Returns:

  • levels (list) – Degree levels, ex: Master, Bachelor, PhD

  • degs (list) – Area of study, ex: Mechanical Engineering

  • schools (list) – School awarding the degree.

property publications

Get the publications this researcher contributed to.

Returns:

pubs (list) – All publications associated with this researcher.

download(fp)[source]

Download text file containing researchers profile information.

Parameters:

fp (str) – Filepath to download this record to.

clear() None.  Remove all items from D.
copy() a shallow copy of D
fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
pop(k[, d]) v, remove specified key and return the corresponding value.

If key is not found, default is returned if given, otherwise KeyError is raised

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D's values