Users¶
-
class
trakt.users.
User
(username)¶ A Trakt.tv User
-
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.
-
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.
-
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_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
(**kwargs)¶ 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
(**kwargs)¶ Returns stats about the movies, shows, and episodes a user has watched and collected
-
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.
-
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.
-
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
(**kwargs)¶ 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?
-
get_items
(**kwargs)¶ A list of the list items using class instances instance types: movie, show, season, episode, person
-
classmethod
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.gender
'male'
>>> my.location
'Newmarket NH'
>>> my.movie_collection
[<Movie>: b'2 Fast 2 Furious', <Movie>: b'A Beautiful Mind', <Movie>: b'A Bronx Tale', <Movie>: b"A Bug's Life", <Movie>: b'A Christmas Carol',...