CurrentUser
The canvasapi.current_user.CurrentUser class is a subclass of canvasapi.user.User, and thus also includes all of its methods.
Documentation for the User class
- class canvasapi.current_user.CurrentUser(_requester)
- Parameters:
requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through.attributes (dict) – The JSON object to build this object with.
- add_favorite_course(course, use_sis_id=False, **kwargs)
Add a course to the current user’s favorites. If the course is already in the user’s favorites, nothing happens.
- Calls:
- Parameters:
course (
canvasapi.course.Courseor int) – The course or ID/SIS ID of the course.use_sis_id (bool) – Whether or not course is an sis ID. Defaults to False.
- Return type:
- add_favorite_group(group, use_sis_id=False, **kwargs)
Add a group to the current user’s favorites. If the group is already in the user’s favorites, nothing happens.
- Calls:
- Parameters:
group (
canvasapi.group.Groupor int) – The ID or SIS ID of the group.use_sis_id (bool) – Whether or not group is an sis ID. Defaults to False.
- Return type:
- create_bookmark(name, url, **kwargs)
Create a new Bookmark.
- Calls:
- Parameters:
name (str) – The name of the bookmark.
url (str) – The url of the bookmark.
- Return type:
- get_bookmark(bookmark, **kwargs)
Return single Bookmark by id
- Calls:
- Parameters:
bookmark (
canvasapi.bookmark.Bookmarkor int) – The object or ID of the bookmark.- Return type:
- get_bookmarks(**kwargs)
List bookmarks that the current user can view or manage.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.bookmark.Bookmark
- get_favorite_courses(**kwargs)
Retrieve the paginated list of favorite courses for the current user. If the user has not chosen any favorites, then a selection of currently enrolled courses will be returned.
- get_favorite_groups(**kwargs)
Retrieve the paginated list of favorite groups for the current user. If the user has not chosen any favorites, then a selection of groups that the user is a member of will be returned.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.group.Group
- get_groups(**kwargs)
Return the list of active groups for the user.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.group.Group
- reset_favorite_courses(**kwargs)
Reset the current user’s course favorites to the default automatically generated list of enrolled courses
- Calls:
- Returns:
True if reset correctly, False otherwise.
- Return type:
bool
- reset_favorite_groups(**kwargs)
Reset the current user’s group favorites to the default automatically generated list of enrolled groups
- Calls:
- Returns:
True if reset correctly, False otherwise.
- Return type:
bool