pip install fenixedu
- Import python sdk
import fenixedu
-
Clone this repository or just download fenixedu.sample.ini file
-
Copy file fenixedu.sample.ini to a new one named 'fenixedu.ini' or with another name if you want
cp fenixedu.sample.ini FILENAME
-
Edit the file according to your application info
-
Instantiate a configuration object using the file
config = fenixedu.FenixEduConfiguration.fromConfigFile('FILENAME')
- If no FILENAME is provided it will use 'fenixedu.ini'
config = fenixedu.FenixEduConfiguration('CLIENT_ID, 'REDIRECT_URI', 'CLIENT_SECRET', 'BASE_URL')
- Instantiate an API client object in your source code
client = fenixedu.FenixEduClient(config)
- Get the authentication URL
url = client.get_authentication_url()
-
Redirect your user to that URL
-
If the user authorizes your application he will be redirected to an URL like this:
redirect_uri?code=CODE
- Get the code parameter in URL and get an object with the user details:
user = client.get_user_by_code(CODE)
-
It will request an access token and returns no errors if everything is fine
-
This user object now can be used to make requests that belong to the private scope like this one:
person = client.get_person(user)
degrees = client.get_degrees()
spaces = client.get_spaces()
person = client.get_person(user)
classes = client.get_person_calendar_classes(user)
payments = client.get_person_payments(user)
-
'[x]' - Optional parameters
-
All endpoints in FenixEdu API have a method in this SDK
-
Mapping between FenixAPISingleton api methods and original API endpoints
-
API endpoint -> SDK FenixAPISingleton Methods
-
GET /about ->
get_about
-
GET /academicterms ->
get_academic_terms
-
GET /courses/{id} ->
get_course(id)
-
GET /courses/{id}/evaluations ->
get_course_evaluations(id)
-
GET /courses/{id}/groups ->
get_course_groups(id)
-
GET /courses/{id}/schedule ->
get_course_schedule(id)
-
GET /courses/{id}/students ->
get_course_students(id)
-
GET /degrees ->
get_degrees([year])
-
GET /degrees/{id} ->
get_degree(id, [year])
-
GET /degrees/{id}/courses ->
get_degree_courses(id, [year])
-
GET /spaces ->
get_spaces()
-
GET /spaces/{id} ->
get_space(id,[day])
-
GET /person ->
get_person(user)
-
GET /person/calendar/classes ->
get_person_classes_calendar(user)
-
GET /person/calendar/evaluations ->
get_person_evaluations_calendar(user)
-
GET /person/courses ->
get_person_courses(user, [academicTerm])
-
GET /person/evaluations ->
get_person_evaluations(user)
-
GET /person/payments ->
get_person_payments(user)
-
PUT /person/evaluations/{id} ->
enrol_in_evaluation(user, id, [enrol_action])
-
GET /person/curriculum ->
get_person_curriculum(user)