Users¶
- class trakt.users.User(username)¶
A Trakt.tv User
- property followers¶
A list of all followers including the since timestamp which is when the relationship began. Protected users won’t return any data unless you are friends. Any friends of the main user that are protected won’t display data either.
- property following¶
A list of all user’s this
User
follows including the since timestamp which is when the relationship began. Protected users won’t return any data unless you are friends. Any friends of the main user that are protected won’t display data either.
- property friends¶
A list of this
User
’s friends (a 2 way relationship where each user follows the other) including the since timestamp which is when the friendship began. Protected users won’t return any data unless you are friends. Any friends of the main user that are protected won’t display data either.
- static get_follower_requests()¶
Return a list of all pending follower requests for the authenticated user
- get_liked_lists(list_type=None, limit=None)¶
Get items a user likes.
This will return an array of standard media objects. You can optionally limit the type of results to return.
list_type possible values are “comments”, “lists”.
https://trakt.docs.apiary.io/#reference/users/likes/get-likes
- get_list(title)¶
Get the specified list from this
User
. ProtectedUser
’s won’t return any data unless you are friends. To view your own private lists, you will need to authenticate as yourself.
- get_ratings(media_type='movies', rating=None)¶
Get a user’s ratings filtered by type. You can optionally filter for a specific rating between 1 and 10.
- Parameters:
media_type – The type of media to search for. Must be one of ‘movies’, ‘shows’, ‘seasons’, ‘episodes’
rating – Optional rating between 1 and 10
- get_stats()¶
Returns stats about the movies, shows, and episodes a user has watched and collected
- property lists¶
All custom lists for this
User
. ProtectedUser
’s won’t return any data unless you are friends. To view your own private lists, you will need to authenticate as yourself.
- property movie_collection¶
All
Movie
’s in thisUser
’s library collection. Collection items might include blu-rays, dvds, and digital downloads. Protected users won’t return any data unless you are friends.
- property show_collection¶
All
TVShow
’s in thisUser
’s library collection. Collection items might include blu-rays, dvds, and digital downloads. Protected users won’t return any data unless you are friends.
- class trakt.users.UserList(user_name, slug='')¶
A list created by a Trakt.tv
User
- classmethod create(name, creator, description=None, privacy='private', display_numbers=False, allow_comments=True)¶
Create a new custom class:UserList. name is the only required field, but the other info is recommended.
- Parameters:
name – Name of the list.
description – Description of this list.
privacy – Valid values are ‘private’, ‘friends’, or ‘public’
display_numbers – Bool, should each item be numbered?
allow_comments – Bool, are comments allowed?
- classmethod get(title, creator)¶
Returns a single custom
UserList
- Parameters:
title – Name of the list.
- get_items()¶
A list of the list items using class instances instance types: movie, show, season, episode, person
Examples¶
To access a User
all you need do is pass the User
’s username
to the User
’s __init__ method
>>> from trakt.users import User
>>> my = User('moogar0880')
>>> my
'<User>: moogar0880'
Good, now we have a hold of the User
object. Now we can get all of the information
available from this trakt.tv User
.
>>> my.movie_collection
[<Movie>: '2 Fast 2 Furious', <Movie>: 'A Beautiful Mind', <Movie>: 'A Bronx Tale', <Movie>: "A Bug's Life", <Movie>: 'A Christmas Carol',...