EdupageAPI / edupage-api

A python library for accessing your Edupage account
https://edupageapi.github.io/edupage-api/
GNU General Public License v3.0
66 stars 13 forks source link

[Feature request] Child switch #52

Closed agileomartin closed 1 year ago

agileomartin commented 2 years ago

Would it be possible to switch the child in case parent has got several children ?

Example:

edupage.get_timetable( datetime.now( ) ) will only fetch the time table for the "last child"

edupage.get_foreign_timetable(XXXX, datetime.now() ) will raise an "insuficent privigiges" exception

Thank you !

ivanhrabcak commented 2 years ago

I can look into this:)

agileomartin commented 2 years ago

Great Ivan ! Thank you. I have made a custom request .../studentId=XXX as an attempt to switch the child. The request went through, but no change in the result of the get_timetable( ) method.

Thank you for the great work !

ivanhrabcak commented 1 year ago

I found no easy way to list all children, but I've added this in b5c8341.

edupage = # ...

students = edupage.get_students()

# you can do either:
my_child = students[0]
edupage.switch_to_child(my_child)

# or 

my_child_person_id = 1234
edupage.switch_to_child(my_child_person_id)

# do whatever you want to do on the child account

edupage.switch_to_parent() # switch back to the parent account

This feature will be present in the 0.10.4 update.

ivanhrabcak commented 1 year ago

@agileomartin I've created 0.10.4, can you please give me some feedback? Is it working as expected?