User

class feupy.User(pv_fest_id: int, credentials: feupy._Credentials.Credentials)

This class represents the information that can be extracted from your personal webpage.

Parameters:
pv_fest_id

A sort of course specific student identification number

Type:int
course

The course related to this pv_fest_id

Type:Course
credentials

A Credentials object (This is done to avoid having to pass the same Credentials object to every function)

Type:Credentials

Example:

from feupy import Credentials, User

creds = Credentials()

me = User(123456, creds)
all_timetables() → dict

Parses all the timetables related to this user (see timetable.parse_timetables for further info).

Returns:A dictionary which maps a tuple with two datetime.date objects, start and finish (the time span in which this timetable is valid), to a list of dictionaries (see timetable.parse_timetable for an example of such a list).
classes()

Returns the classes you are in as a list of tuples.

Each tuple has 2 elements:
  1. A CurricularUnit object
  2. The class name as a string.
Returns:A list of tuples
courses_units() → list

Returns your grades as a list of tuples.

Each tuple has 2 elements:
  1. A CurricularUnit object which represents a curricular unit that
    you either have had in a previous year or you are currently enrolled in
  2. Either an int which represents the grade you got at that curricular unit or None
    if that grade is not available
Returns:A list of tuples

Example:

from feupy import Credentials, User
from pprint import pprint


creds = Credentials()
me = User.from_credentials(creds)

pprint(me.courses_units())

# You will get something like this:
[(CurricularUnit(419981), 10),
 (CurricularUnit(419982), 11),
 (CurricularUnit(419983), 12),
 (CurricularUnit(419984), 13),
 (CurricularUnit(419985), 14),
 (CurricularUnit(420521), 15),
 (CurricularUnit(419986), None),
 (CurricularUnit(419987), None),
 (CurricularUnit(419988), None),
 (CurricularUnit(419989), None),
 (CurricularUnit(419990), None)]
classmethod from_credentials(credentials: feupy._Credentials.Credentials)

Returns a User object made from the first result from get_pv_fest_ids().

Usually, students are enrolled in only one course, which means that get_pv_fest_ids() tends to be a tuple with a single int.

Parameters:credentials (Credentials) – A Credentials object
Returns:A User object

Example:

from feupy import Credentials, User

creds = Credentials()
me = User.from_credentials(creds)
static get_pv_fest_ids(credentials: feupy._Credentials.Credentials) → tuple

Returns a tuple of ints, each representing a pv_fest_id.

Parameters:credentials (Credentials) – A Credentials object
Returns:A tuple of ints
timetable() → list

Returns the current user timetable as a list of dictionaries if possible, otherwise returns None. (see timetable.parse_current_timetable() for more info)

Returns:A list of dicts