exams

feupy.exams.exams(url: str, use_cache: bool = True, base_url: str = 'https://sigarra.up.pt/feup/en/') → list

Returns a list of dictionaries.

Each dictionary represents an exam and has 6 keys:

key value
“curricular unit” (feupy.CurricularUnit) The subject being evaluated
“finish” (datetime.datetime) The finish time of the exam
“observations” (str)
“rooms” (tuple(str)) The rooms in which the exam will take place
“season” (str)
“start” (datetime.datetime) The start time of the exam

Note

If a value is not available, it will be set to None.

Parameters:
  • url (str) – The url of the page with the exams to be parsed
  • use_cache (bool, optional) – Attempts to use the cache if True, otherwise it will fetch from sigarra
Returns:

A list of dictionaries

Example:

from feupy.exams import exams
from pprint import pprint

mieic_exams_url = "https://sigarra.up.pt/feup/pt/exa_geral.mapa_de_exames?p_curso_id=742"

pprint(exams(mieic_exams_url))
# You'll get something like this:
[{'curricular unit': CurricularUnit(420016),
'finish': datetime.datetime(2019, 9, 4, 12, 0),
'observations': 'Exame em comum com Mecanica.Exame em comum com o da Época '
                'de Conclusão de Curso',
'rooms': ('B222',),
'season': 'Exames ao abrigo de estatutos especiais - Port.Est.Especiais 2ºS',
'start': datetime.datetime(2019, 9, 4, 9, 0)},

{'curricular unit': CurricularUnit(419990),
'finish': datetime.datetime(2019, 9, 6, 17, 0),
'observations': 'Sala de exame - Em principio 2 alunos ',
'rooms': ('B222',),
'season': 'Exames ao abrigo de estatutos especiais - Port.Est.Especiais 2ºS',
'start': datetime.datetime(2019, 9, 6, 14, 0)},

{'curricular unit': CurricularUnit(420021),
'finish': datetime.datetime(2019, 9, 18, 17, 30),
'observations': 'Sala de exame - possivelmente 3 alunos ',
'rooms': None,
'season': 'Exames ao abrigo de estatutos especiais - Port.Est.Especiais 2ºS',
'start': datetime.datetime(2019, 9, 18, 14, 30)},

{'curricular unit': CurricularUnit(438941),
'finish': datetime.datetime(2019, 9, 25, 13, 0),
'observations': None,
'rooms': ('B104', 'B208', 'B213'),
'season': 'Exames ao abrigo de estatutos especiais - Mini-testes (1ºS)',
'start': datetime.datetime(2019, 9, 25, 9, 0)},

{'curricular unit': CurricularUnit(438941),
'finish': datetime.datetime(2019, 9, 25, 17, 30),
'observations': None,
'rooms': ('B104', 'B213', 'B208', 'B207'),
'season': 'Exames ao abrigo de estatutos especiais - Mini-testes (1ºS)',
'start': datetime.datetime(2019, 9, 25, 13, 30)},

{'curricular unit': CurricularUnit(438941),
'finish': datetime.datetime(2019, 9, 26, 13, 0),
'observations': None,
'rooms': ('B104', 'B208', 'B213'),
'season': 'Exames ao abrigo de estatutos especiais - Mini-testes (1ºS)',
'start': datetime.datetime(2019, 9, 26, 9, 0)},

{'curricular unit': CurricularUnit(438941),
'finish': datetime.datetime(2019, 9, 26, 17, 30),
'observations': None,
'rooms': ('B104', 'B213', 'B208', 'B207'),
'season': 'Exames ao abrigo de estatutos especiais - Mini-testes (1ºS)',
'start': datetime.datetime(2019, 9, 26, 13, 30)}]