Learn More¶
API¶
Interfaces¶
Trakt['auth']
¶
Trakt['calendars/all/*']
¶
-
class
trakt.interfaces.calendars.all.
AllCalendarsInterface
(client)¶ -
get
(media, collection=None, start_date=None, days=None, **kwargs)¶ Retrieve calendar items.
The all calendar displays info for all shows airing during the specified period. The my calendar displays episodes for all shows that have been watched, collected, or watchlisted.
Parameters: - source (str) – Calendar source (all or my)
- media (str) – Media type (dvd, movies or shows)
- collection (str or None) – Collection type (new, premieres)
- start_date (datetime or None) – Start date (defaults to today)
- days (int or None) – Number of days to display (defaults to 7)
- query (str or None) – Search title or description.
- years (int or str or tuple or None) – Year or range of years (e.g. 2014, or 2014-2016)
- genres (str or list of str or None) – Genre slugs (e.g. action)
- languages (str or list of str or None) – Language codes (e.g. en)
- countries (str or list of str or None) – Country codes (e.g. us)
- runtimes (str or tuple or None) – Runtime range in minutes (e.g. 30-90)
- ratings (str or tuple or None) – Rating range between 0 and 100 (e.g. 75-100)
- certifications (str or list of str or None) – US Content Certification (e.g. pg-13, tv-pg)
- networks (str or list of str or None) – (TV) Network name (e.g. HBO)
- status (str or list of str or None) – (TV) Show status (e.g. returning series, in production, ended`)
Returns: Items
Return type: list of trakt.objects.video.Video
-
new
(media, **kwargs)¶
-
premieres
(media, **kwargs)¶
-
Trakt['calendars/my/*']
¶
-
class
trakt.interfaces.calendars.my.
MyCalendarsInterface
(client)¶ -
get
(media, collection=None, start_date=None, days=None, **kwargs)¶ Retrieve calendar items.
The all calendar displays info for all shows airing during the specified period. The my calendar displays episodes for all shows that have been watched, collected, or watchlisted.
Parameters: - source (str) – Calendar source (all or my)
- media (str) – Media type (dvd, movies or shows)
- collection (str or None) – Collection type (new, premieres)
- start_date (datetime or None) – Start date (defaults to today)
- days (int or None) – Number of days to display (defaults to 7)
- query (str or None) – Search title or description.
- years (int or str or tuple or None) – Year or range of years (e.g. 2014, or 2014-2016)
- genres (str or list of str or None) – Genre slugs (e.g. action)
- languages (str or list of str or None) – Language codes (e.g. en)
- countries (str or list of str or None) – Country codes (e.g. us)
- runtimes (str or tuple or None) – Runtime range in minutes (e.g. 30-90)
- ratings (str or tuple or None) – Rating range between 0 and 100 (e.g. 75-100)
- certifications (str or list of str or None) – US Content Certification (e.g. pg-13, tv-pg)
- networks (str or list of str or None) – (TV) Network name (e.g. HBO)
- status (str or list of str or None) – (TV) Show status (e.g. returning series, in production, ended`)
Returns: Items
Return type: list of trakt.objects.video.Video
-
new
(media, **kwargs)¶
-
premieres
(media, **kwargs)¶
-
Trakt['lists']
¶
Trakt['movies']
¶
Trakt['oauth']
¶
-
class
trakt.interfaces.oauth.
OAuthInterface
(client)¶ -
pin_url
()¶
-
token
(code=None, redirect_uri=None, grant_type='authorization_code')¶
-
token_exchange
(code=None, redirect_uri=None, grant_type='authorization_code', **kwargs)¶
-
token_refresh
(refresh_token=None, redirect_uri=None, grant_type='refresh_token', **kwargs)¶
-
Trakt['oauth/device']
¶
Trakt['scrobble']
¶
-
class
trakt.interfaces.scrobble.
ScrobbleInterface
(client)¶ -
action
(action, movie=None, show=None, episode=None, progress=0.0, **kwargs)¶ Perform scrobble action.
Parameters: - action (
str
) – Action to perform (eitherstart
,pause
orstop
) - movie (
dict
) –Movie definition (or None)
Example:
{ 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'tmdb': 118340 } }
- show (
dict
) –Show definition (or None)
Example:
{ 'title': 'Breaking Bad', 'year': 2008, 'ids': { 'tvdb': 81189 } }
- episode (
dict
) –Episode definition (or None)
Example:
{ "season": 3, "number": 11 }
- progress (
float
) – Current movie/episode progress percentage - kwargs (
dict
) – Extra request options
Returns: Response (or None)
Example:
{ 'action': 'start', 'progress': 1.25, 'sharing': { 'facebook': true, 'twitter': true, 'tumblr': false }, 'movie': { 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'trakt': 28, 'slug': 'guardians-of-the-galaxy-2014', 'imdb': 'tt2015381', 'tmdb': 118340 } } }
Return type: - action (
-
pause
(movie=None, show=None, episode=None, progress=0.0, **kwargs)¶ Send the scrobble “pause’ action.
Use this method when the video is paused. The playback progress will be saved and
Trakt['sync/playback'].get()
can be used to resume the video from this exact position. Un-pause a video by calling theTrakt['scrobble'].start()
method again.Parameters: - movie (
dict
) –Movie definition (or None)
Example:
{ 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'tmdb': 118340 } }
- show (
dict
) –Show definition (or None)
Example:
{ 'title': 'Breaking Bad', 'year': 2008, 'ids': { 'tvdb': 81189 } }
- episode (
dict
) –Episode definition (or None)
Example:
{ "season": 3, "number": 11 }
- progress (
float
) – Current movie/episode progress percentage - kwargs (
dict
) – Extra request options
Returns: Response (or None)
Example:
{ 'action': 'pause', 'progress': 75, 'sharing': { 'facebook': true, 'twitter': true, 'tumblr': false }, 'movie': { 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'trakt': 28, 'slug': 'guardians-of-the-galaxy-2014', 'imdb': 'tt2015381', 'tmdb': 118340 } } }
Return type: - movie (
-
start
(movie=None, show=None, episode=None, progress=0.0, **kwargs)¶ Send the scrobble “start” action.
Use this method when the video initially starts playing or is un-paused. This will remove any playback progress if it exists.
Note: A watching status will auto expire after the remaining runtime has elapsed. There is no need to re-send every 15 minutes.
Parameters: - movie (
dict
) –Movie definition (or None)
Example:
{ 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'tmdb': 118340 } }
- show (
dict
) –Show definition (or None)
Example:
{ 'title': 'Breaking Bad', 'year': 2008, 'ids': { 'tvdb': 81189 } }
- episode (
dict
) –Episode definition (or None)
Example:
{ "season": 3, "number": 11 }
- progress (
float
) – Current movie/episode progress percentage - kwargs (
dict
) – Extra request options
Returns: Response (or None)
Example:
{ 'action': 'start', 'progress': 1.25, 'sharing': { 'facebook': true, 'twitter': true, 'tumblr': false }, 'movie': { 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'trakt': 28, 'slug': 'guardians-of-the-galaxy-2014', 'imdb': 'tt2015381', 'tmdb': 118340 } } }
Return type: - movie (
-
stop
(movie=None, show=None, episode=None, progress=0.0, **kwargs)¶ Send the scrobble “stop” action.
Use this method when the video is stopped or finishes playing on its own. If the progress is above 80%, the video will be scrobbled and the
action
will be set to scrobble.If the progress is less than 80%, it will be treated as a pause and the
action
will be set to pause. The playback progress will be saved andTrakt['sync/playback'].get()
can be used to resume the video from this exact position.Note: If you prefer to use a threshold higher than 80%, you should use
Trakt['scrobble'].pause()
yourself so it doesn’t create duplicate scrobbles.Parameters: - movie (
dict
) –Movie definition (or None)
Example:
{ 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'tmdb': 118340 } }
- show (
dict
) –Show definition (or None)
Example:
{ 'title': 'Breaking Bad', 'year': 2008, 'ids': { 'tvdb': 81189 } }
- episode (
dict
) –Episode definition (or None)
Example:
{ "season": 3, "number": 11 }
- progress (
float
) – Current movie/episode progress percentage - kwargs (
dict
) – Extra request options
Returns: Response (or None)
Example:
{ 'action': 'scrobble', 'progress': 99.9, 'sharing': { 'facebook': true, 'twitter': true, 'tumblr': false }, 'movie': { 'title': 'Guardians of the Galaxy', 'year': 2014, 'ids': { 'trakt': 28, 'slug': 'guardians-of-the-galaxy-2014', 'imdb': 'tt2015381', 'tmdb': 118340 } } }
Return type: - movie (
-
Trakt['search']
¶
-
class
trakt.interfaces.search.
SearchInterface
(client)¶ -
lookup
(id, service=None, media=None, extended=None, page=None, per_page=None, **kwargs)¶ Lookup items by their Trakt, IMDB, TMDB, TVDB, or TVRage ID.
Note: If you lookup an identifier without a
media
type specified it might return multiple items if theservice
is not globally unique.Parameters: - id (
str
orint
) – Identifier value to lookup - service (
str
) –Identifier service
- Possible values:
trakt
imdb
tmdb
tvdb
tvrage
- media (
str
orlist
ofstr
) –Desired media type (or
None
to return all matching items)- Possible values:
movie
show
episode
person
list
- extended (
str
) –Level of information to include in response
- Possible values:
None
: Minimal (e.g. title, year, ids) (default)full
: Complete
- kwargs (
dict
) – Extra request options
Returns: Results
Return type: - id (
-
query
(query, media=None, year=None, fields=None, extended=None, page=None, per_page=None, **kwargs)¶ Search by titles, descriptions, translated titles, aliases, and people.
Note: Results are ordered by the most relevant score.
Parameters: - query (
str
) – Search title or description - media (
str
orlist
ofstr
) –Desired media type (or
None
to return all matching items)- Possible values:
movie
show
episode
person
list
- year (
str
orint
) – Desired media year (orNone
to return all matching items) - fields (
str
orlist
) – Fields to search forquery
(orNone
to search all fields) - extended (
str
) –Level of information to include in response
- Possible values:
None
: Minimal (e.g. title, year, ids) (default)full
: Complete
- kwargs (
dict
) – Extra request options
Returns: Results
Return type: - query (
-
Trakt['shows']
¶
-
class
trakt.interfaces.shows.
ShowsInterface
(client)¶ -
episode
(id, season, episode, extended=None, **kwargs)¶
-
get
(id, extended=None, **kwargs)¶
-
last_episode
(id, extended=None, **kwargs)¶
-
next_episode
(id, extended=None, **kwargs)¶
-
popular
(extended=None, page=None, per_page=None, **kwargs)¶
-
progress
(progress_type, id, hidden=False, specials=False, count_specials=True, **kwargs)¶
-
progress_collection
(id, hidden=False, specials=False, count_specials=True, **kwargs)¶
-
progress_watched
(id, hidden=False, specials=False, count_specials=True, **kwargs)¶
-
recommended
(period=None, extended=None, page=None, per_page=None, **kwargs)¶
-
season
(id, season, extended=None, **kwargs)¶
-
seasons
(id, extended=None, **kwargs)¶
-
trending
(extended=None, page=None, per_page=None, **kwargs)¶
-
Trakt['sync']
¶
Trakt['sync/collection']
¶
Trakt['sync/history']
¶
-
class
trakt.interfaces.sync.history.
SyncHistoryInterface
(client)¶ -
add
(items, **kwargs)¶
-
episodes
(id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
flags
= {'is_watched': True}¶
-
get
(media=None, id=None, start_at=None, end_at=None, store=None, extended=None, page=None, per_page=None, **kwargs)¶
-
movies
(id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
remove
(items, **kwargs)¶
-
seasons
(id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
shows
(id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
Trakt['sync/playback']
¶
Trakt['sync/ratings']
¶
-
class
trakt.interfaces.sync.ratings.
SyncRatingsInterface
(client)¶ -
add
(items, **kwargs)¶
-
all
(rating=None, store=None, **kwargs)¶
-
episodes
(rating=None, store=None, **kwargs)¶
-
flags
= {}¶
-
get
(media=None, rating=None, store=None, extended=None, flat=False, page=None, per_page=None, **kwargs)¶
-
movies
(rating=None, store=None, **kwargs)¶
-
remove
(items, **kwargs)¶
-
seasons
(rating=None, store=None, **kwargs)¶
-
shows
(rating=None, store=None, **kwargs)¶
-
Trakt['sync/watched']
¶
Trakt['sync/watchlist']
¶
-
class
trakt.interfaces.sync.watchlist.
SyncWatchlistInterface
(client)¶ -
add
(items, **kwargs)¶
-
episodes
(sort=None, store=None, **kwargs)¶
-
flags
= {'in_watchlist': True}¶
-
get
(media=None, sort=None, store=None, extended=None, flat=False, page=None, per_page=None, **kwargs)¶
-
movies
(sort=None, store=None, **kwargs)¶
-
remove
(items, **kwargs)¶
-
seasons
(sort=None, store=None, **kwargs)¶
-
shows
(sort=None, store=None, **kwargs)¶
-
Trakt['users']
¶
Trakt['users/*/following']
¶
Trakt['users/*/friends']
¶
Trakt['users/*/history']
¶
-
class
trakt.interfaces.users.history.
UsersHistoryInterface
(client)¶ -
episodes
(username, id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
flags
= {'is_watched': True}¶
-
get
(username, media=None, id=None, start_at=None, end_at=None, store=None, extended=None, page=None, per_page=None, **kwargs)¶
-
movies
(username, id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
seasons
(username, id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
shows
(username, id=None, start_at=None, end_at=None, store=None, **kwargs)¶
-
Trakt['users/*/lists']
¶
-
class
trakt.interfaces.users.lists.
UsersListsInterface
(client)¶ -
create
(username, name, description=None, privacy='private', display_numbers=False, allow_comments=True, sort_by='rank', sort_how='asc', **kwargs)¶ Create a new list.
Parameters: - username (
str
) – Username (orme
) - name (
str
) – Name - description (
bool
) – Description - privacy – Privacy (
private
,friends
, orpublic
) - display_numbers – Flag indicating this list displays numbers
- allow_comments – Flag indicating this list allows comments
- sort_by (
str
) – Sort By (rank
,added
,title
,released
,runtime
,popularity
,percentage
,votes
,my_rating
,random
,watched
,collected
) - sort_how (
str
) – Sort Direction (asc
, ordesc
)
Returns: List
Return type: trakt.objects.CustomList
- username (
-
Trakt['users/*/lists/*']
¶
-
class
trakt.interfaces.users.lists.list_.
UsersListInterface
(client)¶ -
add
(username, id, items, **kwargs)¶
-
delete
(username, id, **kwargs)¶
-
get
(username, id, **kwargs)¶
-
items
(username, id, media=None, extended=None, page=None, per_page=None, **kwargs)¶
-
like
(username, id, **kwargs)¶
-
remove
(username, id, items, **kwargs)¶
-
unlike
(username, id, **kwargs)¶
-
update
(username, id, name=None, description=None, privacy=None, display_numbers=None, allow_comments=None, return_type='object', **kwargs)¶
-
Trakt['users/*']
¶
Trakt['users/*/ratings']
¶
-
class
trakt.interfaces.users.ratings.
UsersRatingsInterface
(client)¶ -
all
(username, rating=None, store=None, **kwargs)¶
-
episodes
(username, rating=None, store=None, **kwargs)¶
-
get
(username, media=None, rating=None, store=None, extended=None, page=None, per_page=None, **kwargs)¶
-
movies
(username, rating=None, store=None, **kwargs)¶
-
seasons
(username, rating=None, store=None, **kwargs)¶
-
shows
(username, rating=None, store=None, **kwargs)¶
-
Trakt['users/settings']
¶
Trakt['users/*/watched']
¶
Trakt['users/*/watchlist']
¶
-
class
trakt.interfaces.users.watchlist.
UsersWatchlistInterface
(client)¶ -
episodes
(username, sort=None, store=None, **kwargs)¶
-
flags
= {'in_watchlist': True}¶
-
get
(username, media=None, sort=None, store=None, extended=None, page=None, per_page=None, **kwargs)¶
-
movies
(username, sort=None, store=None, **kwargs)¶
-
seasons
(username, sort=None, store=None, **kwargs)¶
-
shows
(username, sort=None, store=None, **kwargs)¶
-
Objects¶
Comment
¶
-
class
trakt.objects.comment.
Comment
(client, keys)¶ Bases:
object
-
keys
= None¶ Type: list
oftuple
Keys (for trakt, imdb, tvdb, etc..), defined as:
..code-block:
[ (<service>, <id>) ]
-
Episode
¶
-
class
trakt.objects.episode.
Episode
(client, keys=None, index=None)¶ Bases:
trakt.objects.video.Video
-
get_key
(service)¶
-
pk
¶ Retrieve the primary key (unique identifier for the item).
- Provides the following identifiers (by media type):
- movie: imdb
- show: tvdb
- season: tvdb
- episode: tvdb
- custom_list: trakt
- person: tmdb
Returns: (<service>, <value>)
orNone
if no primary key is availableReturn type: tuple
-
season
= None¶ Type: trakt.objects.season.Season
Season
-
show
= None¶ Type: trakt.objects.show.Show
Show
-
to_identifier
()¶ Retrieve the episode identifier.
Returns: Episode identifier/definition Return type: dict
-
to_info
()¶ Dump episode to a dictionary.
Deprecated: use the
to_dict()
method instead.
-
List
¶
-
class
trakt.objects.list.base.
List
(client, keys)¶ Bases:
object
-
items
(**kwargs)¶ Retrieve list items.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Current list items Return type: list
oftrakt.objects.media.Media
-
keys
= None¶ Type: list
oftuple
Keys (for trakt, imdb, tvdb, etc..), defined as:
..code-block:
[ (<service>, <id>) ]
-
like
(**kwargs)¶ Like the list.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Boolean to indicate if the request was successful Return type: bool
-
pk
¶ Retrieve the primary key (unique identifier for the list).
Returns: ("trakt", <id>)
orNone
if no primary key is availableReturn type: tuple
-
sort_by
= None¶ Type: str
Sort By
- Possible values:
rank
added
title
released
runtime
popularity
percentage
votes
my_rating
random
watched
collected
-
unlike
(**kwargs)¶ Un-like the list.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Boolean to indicate if the request was successful Return type: bool
-
user
= None¶ Type: trakt.objects.User
Author
-
CustomList
¶
-
class
trakt.objects.list.custom.
CustomList
(client, keys)¶ Bases:
trakt.objects.list.base.List
-
add
(items, **kwargs)¶ Add specified items to the list.
Parameters: Returns: Response
Return type:
-
delete
(**kwargs)¶ Delete the list.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Boolean to indicate if the request was successful Return type: bool
-
items
(**kwargs)¶ Retrieve list items.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Current list items Return type: list
oftrakt.objects.media.Media
-
like
(**kwargs)¶ Like the list.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Boolean to indicate if the request was successful Return type: bool
-
pk
¶ Retrieve the primary key (unique identifier for the list).
Returns: ("trakt", <id>)
orNone
if no primary key is availableReturn type: tuple
-
remove
(items, **kwargs)¶ Remove specified items from the list.
Parameters: Returns: Response
Return type:
-
unlike
(**kwargs)¶ Un-like the list.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Boolean to indicate if the request was successful Return type: bool
-
PublicList
¶
-
class
trakt.objects.list.public.
PublicList
(client, keys)¶ Bases:
trakt.objects.list.base.List
-
items
(**kwargs)¶ Retrieve list items.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Current list items Return type: list
oftrakt.objects.media.Media
-
like
(**kwargs)¶ Like the list.
Parameters: kwargs ( dict
) – Extra request optionsReturns: Boolean to indicate if the request was successful Return type: bool
-
pk
¶ Retrieve the primary key (unique identifier for the list).
Returns: ("trakt", <id>)
orNone
if no primary key is availableReturn type: tuple
-
Media
¶
-
class
trakt.objects.media.
Media
(client, keys=None, index=None)¶ Bases:
object
-
get_key
(service)¶
-
images
= None¶ Type: dict
Images (or None), defined as:
{ <type>: { <size>: <url> } }
Type Size Dimensions banner
full
1000x185 (movie/show), 758x140 (show) clearart
full
1000x562 fanart
full
1920x1080 (typical), 1280x720 medium
1280x720 thumb
853x480 logo
full
800x310 poster
full
1000x1500 medium
600x900 thumb
300x450 thumb
full
1000x562 (movie), 500x281 (show)
-
keys
= None¶ Type: list
oftuple
Keys (for imdb, tvdb, etc..), defined as:
..code-block:
[ (<service>, <id>) ]
-
Movie
¶
-
class
trakt.objects.movie.
Movie
(client, keys, index=None)¶ Bases:
trakt.objects.video.Video
-
get_key
(service)¶
-
pk
¶ Retrieve the primary key (unique identifier for the item).
- Provides the following identifiers (by media type):
- movie: imdb
- show: tvdb
- season: tvdb
- episode: tvdb
- custom_list: trakt
- person: tmdb
Returns: (<service>, <value>)
orNone
if no primary key is availableReturn type: tuple
-
to_identifier
()¶ Return the movie identifier which is compatible with requests that require movie definitions.
Returns: Movie identifier/definition Return type: dict
-
to_info
()¶ Dump movie to a dictionary.
Deprecated: use the
to_dict()
method instead.
-
user_count
= None¶ Type: int
Number of user recommendations (returned by the
Trakt['movies'].recommended()
andTrakt['shows'].recommended()
methods)
-
Person
¶
BaseProgress
¶
CollectionProgress
¶
-
class
trakt.objects.progress.collection.
CollectionProgress
(client, aired=None, completed=None)¶ Bases:
trakt.objects.progress.show.ShowProgress
-
progress_type
= 'collection'¶
-
EpisodeProgress
¶
SeasonProgress
¶
ShowProgress
¶
-
class
trakt.objects.progress.show.
ShowProgress
(client, aired=None, completed=None)¶ Bases:
trakt.objects.progress.base.BaseProgress
Type: dict
Hidden Seasons, defined as
{season_num: Season}
-
last_episode
= None¶ Type: trakt.objects.episode.Episode
Last Episode the user watched or collected
-
next_episode
= None¶ Type: trakt.objects.episode.Episode
Next Episode the user should watch or collect
WatchedProgress
¶
-
class
trakt.objects.progress.watched.
WatchedProgress
(client, aired=None, completed=None)¶ Bases:
trakt.objects.progress.show.ShowProgress
-
progress_type
= 'watched'¶
-
Rating
¶
Season
¶
-
class
trakt.objects.season.
Season
(client, keys=None, index=None)¶ Bases:
trakt.objects.media.Media
-
episodes
= None¶ Type: dict
Episodes, defined as
{episode_num: Episode}
Note: this field might not be available with some methods
-
get_key
(service)¶
-
pk
¶ Retrieve the primary key (unique identifier for the item).
- Provides the following identifiers (by media type):
- movie: imdb
- show: tvdb
- season: tvdb
- episode: tvdb
- custom_list: trakt
- person: tmdb
Returns: (<service>, <value>)
orNone
if no primary key is availableReturn type: tuple
-
show
= None¶ Type: trakt.objects.show.Show
Show
-
to_identifier
()¶ Return the season identifier which is compatible with requests that require season definitions.
Returns: Season identifier/definition Return type: dict
-
to_info
()¶ Dump season to a dictionary.
Deprecated: use the
to_dict()
method instead.
-
Show
¶
-
class
trakt.objects.show.
Show
(client, keys, index=None)¶ Bases:
trakt.objects.media.Media
-
episodes
()¶ Return a flat episode iterator.
Returns: Iterator ((season_num, episode_num), Episode)
Return type: iterator
-
get_key
(service)¶
-
pk
¶ Retrieve the primary key (unique identifier for the item).
- Provides the following identifiers (by media type):
- movie: imdb
- show: tvdb
- season: tvdb
- episode: tvdb
- custom_list: trakt
- person: tmdb
Returns: (<service>, <value>)
orNone
if no primary key is availableReturn type: tuple
-
seasons
= None¶ Type: dict
Seasons, defined as
{season_num: Season}
Note: this field might not be available with some methods
-
status
= None¶ Type: str
Value of
returning series
(airing right now),in production
(airing soon),planned
(in development),canceled
, orended
-
to_identifier
()¶ Return the show identifier which is compatible with requests that require show definitions.
Returns: Show identifier/definition Return type: dict
-
to_info
()¶ Dump show to a dictionary.
Deprecated: use the
to_dict()
method instead.
-
user_count
= None¶ Type: int
Number of user recommendations (returned by the
Trakt['movies'].recommended()
andTrakt['shows'].recommended()
methods)
-
User
¶
-
class
trakt.objects.user.
User
(client, keys)¶ Bases:
object
-
follow
(**kwargs)¶
-
following
(**kwargs)¶
-
friends
(**kwargs)¶
-
history
(**kwargs)¶
-
keys
= None¶ Type: list
oftuple
Keys (for trakt, imdb, tvdb, etc..), defined as:
..code-block:
[ (<service>, <id>) ]
-
pk
¶ Retrieve the primary key (unique identifier for the user).
Returns: ("trakt", <id>)
orNone
if no primary key is availableReturn type: tuple
-
ratings
(**kwargs)¶
-
unfollow
(**kwargs)¶
-
watchlist
(**kwargs)¶
-
Video
¶
-
class
trakt.objects.video.
Video
(client, keys=None, index=None)¶ Bases:
trakt.objects.media.Media
-
collected_at
= None¶ Type: datetime
Timestamp of when this item was added to your collection (or None)
-
get_key
(service)¶
-
id
= None¶ Type: long
Item id (e.g. history id)
-
Modules¶
trakt
¶
-
class
trakt.
Trakt
¶ Bases:
object
-
client
= <trakt.client.TraktClient object>¶
-
classmethod
construct
()¶
-
-
exception
trakt.
ClientError
(response)¶
-
exception
trakt.
ServerError
(response)¶
trakt.core.configuration
¶
-
class
trakt.core.configuration.
Configuration
(manager)¶ Bases:
object
-
app
(name=None, version=None, date=None, id=None)¶
-
auth
(login=None, token=None)¶
-
client
(id=None, secret=None)¶
-
get
(key, default=None)¶
-
http
(retry=False, max_retries=3, retry_sleep=5, timeout=(6.05, 24))¶
-
trakt.core.context_collection
¶
trakt.core.emitter
¶
-
class
trakt.core.emitter.
Emitter
¶ Bases:
object
-
emit
(event, *args, **kwargs)¶
-
emit_on
(event, *args, **kwargs)¶
-
off
(event=None, func=None)¶
-
on
(events, func=None, on_bound=None)¶
-
once
(event, func=None)¶
-
pipe
(events, other)¶
-
threading
= False¶
-
threading_workers
= 2¶
-
-
trakt.core.emitter.
emit
(emitter, event, *args, **kwargs)¶
-
trakt.core.emitter.
off
(emitter, event, func=None)¶
-
trakt.core.emitter.
on
(emitter, event, func=None)¶
-
trakt.core.emitter.
once
(emitter, event, func=None)¶
-
trakt.core.emitter.
repr_trim
(value, length=1000)¶
trakt.core.errors
¶
-
trakt.core.errors.
log_request_error
(logger, response)¶
trakt.core.exceptions
¶
-
exception
trakt.core.exceptions.
ClientError
(response)¶
-
exception
trakt.core.exceptions.
ServerError
(response)¶
trakt.core.helpers
¶
-
trakt.core.helpers.
clean_username
(username)¶
-
trakt.core.helpers.
deprecated
(message)¶
-
trakt.core.helpers.
dictfilter
(d, **kwargs)¶
-
trakt.core.helpers.
from_iso8601
(value)¶
-
trakt.core.helpers.
from_iso8601_date
(value)¶
-
trakt.core.helpers.
from_iso8601_datetime
(value)¶
-
trakt.core.helpers.
reraise
(tp, value, tb=None)¶
-
trakt.core.helpers.
synchronized
(f_lock, mode='full')¶
-
trakt.core.helpers.
to_iso8601
(value)¶
-
trakt.core.helpers.
to_iso8601_date
(value)¶
-
trakt.core.helpers.
to_iso8601_datetime
(value)¶
-
trakt.core.helpers.
try_convert
(value, value_type, default=None)¶
trakt.core.http
¶
-
class
trakt.core.http.
HTTPSAdapter
(ssl_version=None, *args, **kwargs)¶ Bases:
requests.adapters.HTTPAdapter
-
init_poolmanager
(connections, maxsize, block=False, **pool_kwargs)¶ Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only exposed for use when subclassing the
HTTPAdapter
.Parameters: - connections – The number of urllib3 connection pools to cache.
- maxsize – The maximum number of connections to save in the pool.
- block – Block when no free connections are available.
- pool_kwargs – Extra keyword arguments used to initialize the Pool Manager.
-
-
class
trakt.core.http.
HttpClient
(client, adapter_kwargs=None, keep_alive=True)¶ Bases:
object
-
configure
(path=None)¶
-
delete
(path=None, params=None, data=None, **kwargs)¶
-
get
(path=None, params=None, data=None, **kwargs)¶
-
post
(path=None, params=None, data=None, **kwargs)¶
-
proxies
¶
-
put
(path=None, params=None, data=None, **kwargs)¶
-
rebuild
()¶
-
request
(method, path=None, params=None, data=None, query=None, authenticated=False, validate_token=True, exceptions=False, pagination=False, **kwargs)¶
-
send
(request)¶
-
ssl_version
¶
-
validate
()¶
-
trakt.core.request
¶
-
class
trakt.core.request.
TraktRequest
(client, **kwargs)¶ Bases:
object
-
construct_url
()¶ Construct a full trakt request URI, with params and query.
-
classmethod
encode_query
(parameters)¶
-
classmethod
encode_query_parameter
(value)¶
-
prepare
()¶
-
transform_data
()¶
-
transform_headers
()¶
-
transform_method
()¶
-
transform_parameters
()¶
-
trakt.helpers
¶
-
trakt.helpers.
build_url
(*args, **kwargs)¶
-
trakt.helpers.
has_attribute
(obj, name)¶
-
trakt.helpers.
setdefault
(d, defaults, func=None)¶
trakt.interfaces.base
¶
-
class
trakt.interfaces.base.
Interface
(client)¶ Bases:
object
-
get_data
(response, exceptions=False, parse=True)¶
-
http
¶
-
path
= None¶
-
-
trakt.interfaces.base.
application
(func)¶
-
trakt.interfaces.base.
authenticated
(func)¶
trakt.interfaces.calendars.base
¶
-
class
trakt.interfaces.calendars.base.
CalendarsInterface
(client)¶ Bases:
trakt.interfaces.base.Interface
-
get
(source, media, collection=None, start_date=None, days=None, query=None, years=None, genres=None, languages=None, countries=None, runtimes=None, ratings=None, certifications=None, networks=None, status=None, **kwargs)¶ Retrieve calendar items.
The all calendar displays info for all shows airing during the specified period. The my calendar displays episodes for all shows that have been watched, collected, or watchlisted.
Parameters: - source (str) – Calendar source (all or my)
- media (str) – Media type (dvd, movies or shows)
- collection (str or None) – Collection type (new, premieres)
- start_date (datetime or None) – Start date (defaults to today)
- days (int or None) – Number of days to display (defaults to 7)
- query (str or None) – Search title or description.
- years (int or str or tuple or None) – Year or range of years (e.g. 2014, or 2014-2016)
- genres (str or list of str or None) – Genre slugs (e.g. action)
- languages (str or list of str or None) – Language codes (e.g. en)
- countries (str or list of str or None) – Country codes (e.g. us)
- runtimes (str or tuple or None) – Runtime range in minutes (e.g. 30-90)
- ratings (str or tuple or None) – Rating range between 0 and 100 (e.g. 75-100)
- certifications (str or list of str or None) – US Content Certification (e.g. pg-13, tv-pg)
- networks (str or list of str or None) – (TV) Network name (e.g. HBO)
- status (str or list of str or None) – (TV) Show status (e.g. returning series, in production, ended`)
Returns: Items
Return type: list of trakt.objects.video.Video
-
new
(media, **kwargs)¶
-
premieres
(media, **kwargs)¶
-
trakt.interfaces.sync.core.mixins
¶
-
class
trakt.interfaces.sync.core.mixins.
Add
(client)¶ Bases:
trakt.interfaces.base.Interface
-
add
(items, **kwargs)¶
-
-
class
trakt.interfaces.sync.core.mixins.
Delete
(client)¶ Bases:
trakt.interfaces.base.Interface
-
delete
(playbackid, **kwargs)¶
-
-
class
trakt.interfaces.sync.core.mixins.
Get
(client)¶ Bases:
trakt.interfaces.base.Interface
-
flags
= {}¶
-
get
(media=None, store=None, params=None, query=None, flat=False, **kwargs)¶
-
movies
(store=None, **kwargs)¶
-
shows
(store=None, **kwargs)¶
-
-
class
trakt.interfaces.sync.core.mixins.
Remove
(client)¶ Bases:
trakt.interfaces.base.Interface
-
remove
(items, **kwargs)¶
-
trakt.mapper
¶
-
class
trakt.mapper.
CommentMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
comment
(client, item, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
ListMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
custom_list
(client, item, username=None, **kwargs)¶
-
classmethod
public_list
(client, item, **kwargs)¶
-
classmethod
public_lists
(client, items, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
ListItemMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, item, **kwargs)¶
-
classmethod
episodes
(client, items, **kwargs)¶
-
classmethod
list
(client, item, **kwargs)¶
-
classmethod
movie
(client, item, **kwargs)¶
-
classmethod
officiallist
(client, item, **kwargs)¶
-
classmethod
person
(client, item, **kwargs)¶
-
classmethod
process
(client, item, media=None, **kwargs)¶
-
classmethod
process_many
(client, items, **kwargs)¶
-
classmethod
season
(client, item, **kwargs)¶
-
classmethod
seasons
(client, items, **kwargs)¶
-
classmethod
show
(client, item, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
ProgressMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
progress
(client, progress_type, item, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
SearchMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, item, **kwargs)¶
-
classmethod
episodes
(client, items, **kwargs)¶
-
classmethod
list
(client, item, **kwargs)¶
-
classmethod
movie
(client, item, **kwargs)¶
-
classmethod
officiallist
(client, item, **kwargs)¶
-
classmethod
person
(client, item, **kwargs)¶
-
classmethod
process
(client, item, media=None, **kwargs)¶
-
classmethod
process_many
(client, items, **kwargs)¶
-
classmethod
show
(client, item, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
SummaryMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, item, parse_show=False, **kwargs)¶
-
classmethod
episodes
(client, items, **kwargs)¶
-
classmethod
movie
(client, item, **kwargs)¶
-
classmethod
movies
(client, items, **kwargs)¶
-
classmethod
season
(client, item, **kwargs)¶
-
classmethod
season_episode
(client, season, episode_num, item=None, **kwargs)¶
-
classmethod
seasons
(client, items, **kwargs)¶
-
classmethod
show
(client, item, **kwargs)¶
-
classmethod
shows
(client, items, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
SyncMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, store, item, append=False, **kwargs)¶
-
classmethod
episodes
(client, store, items, **kwargs)¶
-
classmethod
item
(client, store, item, media=None, **kwargs)¶
-
classmethod
iterate_items
(client, store, items, func, media=None, **kwargs)¶
-
classmethod
map_item
(client, store, item, media, key=None, parent=None, append=False, **kwargs)¶
-
classmethod
map_items
(client, store, items, func, **kwargs)¶
-
classmethod
movie
(client, store, item, **kwargs)¶
-
classmethod
movies
(client, store, items, **kwargs)¶
-
classmethod
process
(client, store, items, media=None, flat=False, **kwargs)¶
-
classmethod
season
(client, store, item, **kwargs)¶
-
classmethod
seasons
(client, store, items, **kwargs)¶
-
classmethod
show
(client, store, item, append=False, **kwargs)¶
-
classmethod
show_episode
(client, season, episode_num, item=None, **kwargs)¶
-
classmethod
show_season
(client, show, season_num, item=None, **kwargs)¶
-
classmethod
shows
(client, store, items, **kwargs)¶
-
classmethod
-
class
trakt.mapper.
UserMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
user
(client, item, **kwargs)¶
-
classmethod
users
(client, items, **kwargs)¶
-
classmethod
trakt.mapper.comment
¶
-
class
trakt.mapper.comment.
CommentMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
comment
(client, item, **kwargs)¶
-
classmethod
trakt.mapper.list
¶
-
class
trakt.mapper.list.
ListMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
custom_list
(client, item, username=None, **kwargs)¶
-
classmethod
public_list
(client, item, **kwargs)¶
-
classmethod
public_lists
(client, items, **kwargs)¶
-
classmethod
trakt.mapper.list_item
¶
-
class
trakt.mapper.list_item.
ListItemMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, item, **kwargs)¶
-
classmethod
episodes
(client, items, **kwargs)¶
-
classmethod
list
(client, item, **kwargs)¶
-
classmethod
movie
(client, item, **kwargs)¶
-
classmethod
officiallist
(client, item, **kwargs)¶
-
classmethod
person
(client, item, **kwargs)¶
-
classmethod
process
(client, item, media=None, **kwargs)¶
-
classmethod
process_many
(client, items, **kwargs)¶
-
classmethod
season
(client, item, **kwargs)¶
-
classmethod
seasons
(client, items, **kwargs)¶
-
classmethod
show
(client, item, **kwargs)¶
-
classmethod
trakt.mapper.progress
¶
-
class
trakt.mapper.progress.
ProgressMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
progress
(client, progress_type, item, **kwargs)¶
-
classmethod
trakt.mapper.search
¶
-
class
trakt.mapper.search.
SearchMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, item, **kwargs)¶
-
classmethod
episodes
(client, items, **kwargs)¶
-
classmethod
list
(client, item, **kwargs)¶
-
classmethod
movie
(client, item, **kwargs)¶
-
classmethod
officiallist
(client, item, **kwargs)¶
-
classmethod
person
(client, item, **kwargs)¶
-
classmethod
process
(client, item, media=None, **kwargs)¶
-
classmethod
process_many
(client, items, **kwargs)¶
-
classmethod
show
(client, item, **kwargs)¶
-
classmethod
trakt.mapper.summary
¶
-
class
trakt.mapper.summary.
SummaryMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, item, parse_show=False, **kwargs)¶
-
classmethod
episodes
(client, items, **kwargs)¶
-
classmethod
movie
(client, item, **kwargs)¶
-
classmethod
movies
(client, items, **kwargs)¶
-
classmethod
season
(client, item, **kwargs)¶
-
classmethod
season_episode
(client, season, episode_num, item=None, **kwargs)¶
-
classmethod
seasons
(client, items, **kwargs)¶
-
classmethod
show
(client, item, **kwargs)¶
-
classmethod
shows
(client, items, **kwargs)¶
-
classmethod
trakt.mapper.sync
¶
-
class
trakt.mapper.sync.
SyncMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
episode
(client, store, item, append=False, **kwargs)¶
-
classmethod
episodes
(client, store, items, **kwargs)¶
-
classmethod
item
(client, store, item, media=None, **kwargs)¶
-
classmethod
iterate_items
(client, store, items, func, media=None, **kwargs)¶
-
classmethod
map_item
(client, store, item, media, key=None, parent=None, append=False, **kwargs)¶
-
classmethod
map_items
(client, store, items, func, **kwargs)¶
-
classmethod
movie
(client, store, item, **kwargs)¶
-
classmethod
movies
(client, store, items, **kwargs)¶
-
classmethod
process
(client, store, items, media=None, flat=False, **kwargs)¶
-
classmethod
season
(client, store, item, **kwargs)¶
-
classmethod
seasons
(client, store, items, **kwargs)¶
-
classmethod
show
(client, store, item, append=False, **kwargs)¶
-
classmethod
show_episode
(client, season, episode_num, item=None, **kwargs)¶
-
classmethod
show_season
(client, show, season_num, item=None, **kwargs)¶
-
classmethod
shows
(client, store, items, **kwargs)¶
-
classmethod
trakt.mapper.user
¶
-
class
trakt.mapper.user.
UserMapper
¶ Bases:
trakt.mapper.core.base.Mapper
-
classmethod
user
(client, item, **kwargs)¶
-
classmethod
users
(client, items, **kwargs)¶
-
classmethod
trakt.objects.core.helpers
¶
-
trakt.objects.core.helpers.
update_attributes
(obj, dictionary, keys)¶
Information¶
Changelog¶
5.0.0 (2023-05-04)¶
Breaking Changes
- Dropped support for Python 2.7, 3.5, 3.6
Changed
- Switched to PEP 517 compatible build system
4.3.0 (2021-03-19)¶
Added
- Interfaces:
Trakt['movies']
popular()
Trakt['shows']
popular()
Changed
- Updated “arrow” requirement to support v1.0.0 (#91)
- Updated “requests” requirement to exclude v2.16.0 (#88)
4.2.0 (2020-06-29)¶
Added
- Interfaces:
Trakt['lists']
popular()
,trending()
Trakt['users/*']
get()
,follow()
,unfollow()
Trakt['users/*/watched']
get()
,movies()
,shows()
- Objects:
PublicList
- Properties:
Media
plays
last_updated_at
last_watched_at
reset_at
4.1.0 (2020-05-28)¶
Added
- Documentation is now generated for a number of modules that were previously missing
- Interfaces:
Trakt['sync/watchlist']
- Now supports the
sort
parameter
- Now supports the
Trakt['users/*/following']
Trakt['users/*/friends']
Trakt['users/*/history']
Trakt['users/*/ratings']
Trakt['users/*/watchlist']
- Methods:
Trakt['sync/history']
seasons()
,episodes()
Trakt['sync/ratings']
all()
- Objects:
User
Changed
- Methods:
Trakt['users/*/lists']
create()
now cleans the providedusername
parameter.
4.0.0 (2020-05-15)¶
BREAKING
pagination=True
now always returns aPaginationIterator
with:total_items
- Total number of itemstotal_pages
- Total number of pagesget(page)
- Fetch the specified page__iter__
- Iterate over all items, automatically requesting the next page as required
Trakt['search'].lookup()
now always returns a list of matched items (previously a list was only returned when more than one item was returned)
Added
- Pages can now be requested without using
pagination=True
by using thepage
andper_page
parameters on: Trakt['movies']
trending()
Trakt['search']
lookup()
,query()
Trakt['shows']
trending()
Trakt['sync/history']
get()
,movies()
,shows()
Trakt['sync/ratings']
get()
,movies()
,shows()
,seasons()
,episodes()
Trakt['sync/watchlist']
get()
,seasons()
,episodes()
Trakt['users']
likes()
Trakt['users/*/lists/*']
items()
- Pages can now be requested without using
Trakt['users/*/lists/*'].items()
now supports amedia
parameter (#76)
3.2.0 (2020-03-17)¶
Added
- Exposed episode runtime (#69)
- Support
extended
parameter on listitems()
function (#71)
3.1.0 (2019-10-22)¶
Added
- Support for absolute episode numbers (#63)
- Support for rating votes (#68)
Changed
- Dropped support for Python 3.4
3.0.0 (2018-10-26)¶
Added
- Implemented the show progress interface (#60)
- Support for the
extended
parameter on sync methods (#57)
Changed
- Requests that raise exceptions are now retried (with
retry=True
) - Dropped support for Python 2.6, 3.3
Fixed
- Issue disabling pagination on watchlist requests (#62)
2.14.0 (2017-03-07)¶
Added
- Support for Python 3.6
- Package version is now automatically written into the
trakt.version
module onpython setup.py egg_info
__future__
imports for more consistent Python 3 compatibilitySummaryMapper.episode
method now accepts the “parse_show” parameter- Interfaces:
Trakt['calendars']
(#56)
Changed
- Dropped support for Python 3.2
- Cleaned up documentation
- Switched to pbr setup configuration
- Ordering of import statements has been updated to be more consistent
Tests
- Replaced usage of
responses
in tests withhttmock
- Updated
tox.ini
with additional test environments and flake8 plugins - Improved the
fixtures
directory structure
Travis CI
- Switched to using “tox-travis”, instead of running pytest directly
- Releases are now automatically uploaded to PyPI and GitHub Releases
2.12.0 (2017-01-11)¶
Added
- Improved token refreshing (and added the “oauth.refresh” and “oauth.refresh.rejected” events)
- RequestFailedError exception will now be raised if no response was returned (if exceptions=True)
Trakt.http.keep_alive
property (defaults to :code:`True`)Trakt.http.ssl_version
property (defaults to :code:`None` / :code:`PROTOCOL_TLS` / :code:`PROTOCOL_SSLv23`)
Changed
- Switched default API endpoint to https://api.trakt.tv
- SSL protocol version is now automatically negotiated with the server (instead of defaulting to TLS v1.0)
- Warning will now be displayed if a deadlock is detected inside token refresh events
- Fixed some inconsistencies in the handling of error responses
- Updated bundled emitter module (fuzeman/PyEmitter@3c558c7c2bc3ae07cb1e8e18b2c1c16be042c748)
- Interfaces:
Trakt['search']
- Updated to use the new search endpoints
- Methods:
Trakt['search'].lookup
- Now supports the
extended
parameter
- Now supports the
Trakt['search'].query
- Now supports the
fields
andextended
parameters
- Now supports the
Fixed
@authenticated
decorator wasn’t applied to some methods, resulting in tokens not being refreshed- Exception raised when
Trakt['scrobble']
methods are provided “app_version” or “app_date” parameters - Error responses weren’t being returned correctly with
parse=False
- Issue handling
None
responses in the automatic token refresher - Inconsistent handling of error responses in some methods
2.11.0 (2016-12-20)¶
Added
- Properties
Movie
tagline
released
runtime
certification
updated_at
homepage
trailer
language
available_translations
genres
Show
first_aired
airs
runtime
certification
network
country
updated_at
status
homepage
language
available_translations
genres
aired_episodes
Season
first_aired
episode_count
aired_episodes
Episode
first_aired
updated_at
available_translations
Changed
- Methods on the
Trakt['movies']
andTrakt['shows']
interfaces now support theextended
parameter (#51) - Minor improvements to property descriptions on the
Show
andEpisode
objects
2.10.0 (2016-12-15)¶
Added
- Methods:
Trakt['shows'].next_episode
(#50)Trakt['shows'].last_episode
(#50)
2.9.0 (2016-10-16)¶
Added
- Properties:
Person.listed_at
Video.action
- Methods:
Trakt['sync/history'].get
Trakt['sync/history'].shows
Trakt['sync/history'].movies
Changed
- Updated
SyncMapper
to support flat iterators - Methods:
Trakt['sync/ratings'].get
- Flat iterator will now be returned if no
media
parameter is provided
- Flat iterator will now be returned if no
Trakt['sync/watchlist'].get
- Pagination is now supported, can be enabled with
pagination=True
media
parameter can now be specified asNone
to return all items (with no type filter)
- Pagination is now supported, can be enabled with
Fixed
- Pagination wouldn’t work correctly if a starting page was specified
2.8.0 (2016-09-17)¶
Added
- Lists containing people are now supported (instead of raising an exception)
SyncMapper
can now be used without thestore
parameter- Objects:
Person
- Properties:
Video.id
(history id)Video.watched_at
(history timestamp)
- Methods:
Media.get_key(<service>)
2.7.0 (2016-08-30)¶
Added
- Support for multiple
media
options on theTrakt['search'].query()
method - Implemented the
media
parameter on theTrakt['search'].lookup()
method
Changed
- “Request failed” warnings now display the request method and path to help with debugging
- Improved handling of requirements in [setup.py]
2.6.1 (2016-05-19)¶
Changed
- Updated request error messages
Fixed
- Authorization tokens generated with device authentication wouldn’t refresh correctly
2.6.0 (2016-04-15)¶
Added
Trakt['oauth/device']
(seeexamples/authentication/device.py
for usage details)Trakt['shows'].seasons()
now supports theextended="episodes"
parameter- Pagination can now be enabled with
pagination=True
, warnings will be displayed if you ignore pagination responses
Changed
- Moved the
Trakt['oauth'].pin_url()
method toTrakt['oauth/pin'].url()
, the old method still works but will display a deprecation warning
Fixed
- Issue retrieving lists by users with the
.
character in their usernames
2.5.2 (2016-02-19)¶
Added
in_watchlist
property toMovie
,Show
,Season
andEpisode
objects (#45)Trakt.site_url
setter to override automatic detectionHttpClient
now supports direct calls (#43)
Changed
- Tests are now included in builds, but are excluded from installations
2.5.0 (2015-09-24)¶
Added
Trakt['users'].likes()
methodCustomList.items()
methodComment
objectMedia.index
attribute (list item position/rank)- Basic documentation generation (#29)
NullHandler
to the logger to avoid “No handler found” warnings (#33)
Changed
- ‘movies’ and ‘shows’ interface methods to support the
exceptions=True
parameter (#32) Interface.get_data()
to only parse the response body if the request is successful (#32)
Fixed
TypeError
was raised inSummaryMapper
if the request failed (#30, #31)- Constructing “Special” episodes could raise an
AttributeError
(#38, #39) Media._update()
“images” attribute- Issue serializing
List
objects
2.4.1 (2015-09-12)¶
Fixed
- Issue where the “_client” attribute on objects was being serialized
- Issue installing trakt.py when “arrow” isn’t available yet
2.4.0 (2015-07-09)¶
Added
trending()
method toTrakt['shows']
andTrakt['movies']
interfaces (#23)seasons()
andepisodes()
methods to theTrakt['sync/watchlist']
interface (#26)- Custom lists support (
Trakt['users/*/lists']
,Trakt['users/*/lists/*']
) (#26) __eq__()
method on theRating
classproxies
attribute onTrakt.http
Changed
datetime
objects are now returned offset-aware (make sure you use offset-aware `datetime` objects when comparing timestamps now)- Force requests to use
ssl.PROTOCOL_TLSv1
connections for https:// (#25) - Return site url from
Trakt['oauth'].authorize_url()
- Use season number from parent when one isn’t defined in the episode
2.3.0 (2015-04-11)¶
Changes
- Added support for PIN authentication
- Added automatic OAuth token refreshing (see “examples/pin.py” for an example)
- Added
Trakt.configuration.oauth.from_response()
configuration method - Added tests for the
Trakt['oauth']
interface - Added tests to ensure authentication headers are being sent
Trakt['oauth']
methods now raise an exception if you are missing required configuration parametersTrakt['oauth'].token()
method has been renamed toTrakt['oauth'].token_exchange()
(old method is still present for compatibility)
Fixed
Trakt['oauth']
“_url” methods could raise an exception in some cases
2.2.0 (2015-04-02)¶
Changes
- Added unit tests (with travis-ci.org and coveralls.io integrations)
- Added
/movies
,/shows
,/search
and/users/settings
interfaces - Added parent properties (“show”, “season”)
- Added “images”, “overview” and “score” properties to the
Media
class - Added “last_watched_at” property to movies and episodes
- Updated
/sync/playback
interface (to include type filtering) - “progress” and “paused_at” properties are now included in
to_dict()
Fixed
- “year” property could be returned as a string in some cases
- Catch an exception in
trakt.media_mapper
- Catch a case where
Interface.get_data()
can raise aKeyError: 'content-type'
exception
2.1.1 (2015-02-06)¶
Changes
- Updated to use the new v2 API endpoint (api-v2launch.trakt.tv)
- Episode and Movie
to_dict()
method now always returns “plays” as an integer - Added “http.retry_sleep” and “http.timeout” configuration parameters
- Setup travis/coveralls services
Fixed
- Python 3.x compatibility issues
2.1.0 (2015-02-05)¶
Changes
- Added “exceptions” and “parse” parameter to Interface.get_data()
- Added additional error messages (502, 504, 520)
- Renamed media object to_info() method to to_identifier()
- Added new to_dict() method which returns a dictionary representation of the media object
- Request retrying (on 5xx errors) can now be enabled with Trakt.configuration.http(retry=True)
- requests/urllib3 now retries requests on connection errors (default: 3 retries)
Fixed
- Thread synchronization issue with trakt.core.configuration
- [/sync] last_activities() used an incorrect path
2.0.8 (2015-01-06)¶
- Catch all response errors to avoid issues parsing the returned body
2.0.7 (2015-01-04)¶
- Handle a case where [media_mapper] processes an item with an empty “ids” dict
2.0.6 (2015-01-02)¶
- Switched to manual interface importing to avoid security restrictions
2.0.5 (2015-01-02)¶
- Convert all datetime properties to UTC
2.0.4 (2015-01-02)¶
- Allow for charset definitions in “Content-Type” response header
2.0.3 (2015-01-02)¶
- Display request failed messages in log (with error name/desc)
2.0.2 (2015-01-02)¶
- Fixed broken logging message
2.0.1 (2015-01-02)¶
- Properly handle responses where trakt.tv returns errors without a json body
2.0.0 (2014-12-31)¶
- Re-designed to support trakt 2.0 (note: this isn’t a drop-in update - interfaces, objects and methods have changed to match the new API)
- Support for OAuth and xAuth authentication methods
- Simple configuration system
0.7.0 (2014-10-24)¶
- “title” and “year” parameters are now optional on scrobble() and watching() methods
- [movie] Added unseen() method
- [show/episode] Added unseen() method
0.6.1 (2014-07-10)¶
- Return None if an action fails validation (instead of raising an exception)
0.6.0 (2014-06-23)¶
- Added Trakt.configure() method
- Rebuild session on socket.gaierror (workaround for urllib error)
0.5.3 (2014-05-10)¶
- Fixed bugs sending media actions
- Renamed cancel_watching() to cancelwatching()
- “title” and “year” parameters are now optional on media actions
0.5.2 (2014-04-20)¶
- [movie] Added seen(), library() and unlibrary() methods
- [movie] Implemented media mapping
- [rate] Added shows(), episodes() and movies() methods
- [show] Added unlibrary() method
- [show/episode] Added library() and seen() methods
0.5.1 (2014-04-19)¶
- Added @authenticated to MediaInterface.send()
- Fixed missing imports
0.5.0 (2014-04-18)¶
- Initial release
License¶
The MIT License (MIT)
Copyright (c) 2014 Dean Gardiner
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.