degree

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package degree provides a type to represent a degree course and related functions to fetch data from the unibo website.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Degree

type Degree struct {
	AcademicYear          string // The academic year in which the course is taught
	Code                  int    // The code of the course
	Description           string // The description of the course
	Url                   string // The url of the course website
	Campus                string // The campus where the course is taught
	International         bool   // Whether the course is taught in a language other than Italian
	InternationalTitle    string // The title of the course, if International is true
	InternationalLanguage string // The language in which the course is taught, if International is true
	Fields                string // The fields that the course covers
	Type                  string // The type of the course, e.g. "Laurea triennale"
	DurationInYears       int    // The duration of the course in years, e.g. 3
	OpenForRegistration   string // Whether the course is open for registration
	Languages             string // The languages in which the course is taught
	AccessRequirements    string // The access requirements
	TeachingLocation      string // The main location where the course is taught
	// contains filtered or unexported fields
}

Degree represents a degree course.

It can be obtained from UniBo's open data. See the opendata package for more information.

func (*Degree) Exams added in v0.2.0

func (d *Degree) Exams() ([]exams.Exam, error)

func (*Degree) ExamsForSubject added in v0.2.0

func (d *Degree) ExamsForSubject(subjectName string) ([]exams.Exam, error)

func (*Degree) GetAllCurricula

func (d *Degree) GetAllCurricula() (map[int]curriculum.Curricula, error)

GetAllCurricula returns a map of all curricula of the degree. The keys are the years of the curricula.

Internally, it calls GetCurricula for each year in a separate goroutine, so it is faster than calling GetCurricula for each year.

func (*Degree) GetCurricula

func (d *Degree) GetCurricula(year int) (curriculum.Curricula, error)

GetCurricula returns the curricula of the degree for the given year. The year must be between 1 and the duration of the degree.

func (*Degree) GetTimetable

func (d *Degree) GetTimetable(
	year int,
	curriculum curriculum.Curriculum,
	period *timetable.Interval,
) (timetable.Timetable, error)

GetTimetable returns the timetable of the degree for the given year, curriculum and period.

Use GetCurricula or GetAllCurricula to get a curriculum. See timetable.FetchTimetable for more information.

func (*Degree) ScrapeId

func (d *Degree) ScrapeId() (ID, error)

ScrapeId returns the ID of the course from the given course website url.

type ID

type ID struct {
	Type string // Type is the type of the course, e.g. "laurea".
	Id   string // Id is the id of the course, e.g. "IngegneriaInformatica".
}

ID represents the ID of a course. It is made of a type and an id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL