Learn More

API

Interfaces

Trakt['auth']

class trakt.interfaces.auth.AuthInterface(client)
login(login, password, **kwargs)
logout()

Trakt['calendars/all/*']

class trakt.interfaces.calendars.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['movies']

class trakt.interfaces.movies.MoviesInterface(client)
get(id, extended=None, **kwargs)
popular(extended=None, page=None, per_page=None, **kwargs)
recommended(period=None, extended=None, page=None, per_page=None, **kwargs)
trending(extended=None, page=None, per_page=None, **kwargs)

Trakt['oauth']

class trakt.interfaces.oauth.OAuthInterface(client)
authorize_url(redirect_uri, response_type='code', state=None, username=None)
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']

class trakt.interfaces.oauth.device.DeviceOAuthInterface(client)
code(**kwargs)
poll(device_code, expires_in, interval, **kwargs)

Construct the device authentication poller.

Parameters:
  • device_code (str) – Device authentication code
  • expires_in – Device authentication code expiry (in seconds)
  • interval (int) – Device authentication poll interval
Return type:

DeviceOAuthPoller

token(device_code, **kwargs)

Trakt['oauth/pin']

class trakt.interfaces.oauth.pin.PinOAuthInterface(client)
url()

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 (either start, pause or stop)
  • 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:

dict

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 the Trakt['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:

dict

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:

dict

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 and Trakt['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:

dict

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 the service is not globally unique.

Parameters:
  • id (str or int) – Identifier value to lookup
  • service (str) –

    Identifier service

    Possible values:
    • trakt
    • imdb
    • tmdb
    • tvdb
    • tvrage
  • media (str or list of str) –

    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:

list of trakt.objects.media.Media

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 or list of str) –

    Desired media type (or None to return all matching items)

    Possible values:
    • movie
    • show
    • episode
    • person
    • list
  • year (str or int) – Desired media year (or None to return all matching items)
  • fields (str or list) – Fields to search for query (or None 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:

list of trakt.objects.media.Media

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']

class trakt.interfaces.sync.SyncInterface(client)
last_activities(**kwargs)
playback(store=None, **kwargs)

Trakt['sync/collection']

class trakt.interfaces.sync.collection.SyncCollectionInterface(client)
add(items, **kwargs)
flags = {'is_collected': True}
get(media=None, store=None, params=None, extended=None, **kwargs)
movies(store=None, **kwargs)
remove(items, **kwargs)
shows(store=None, **kwargs)

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']

class trakt.interfaces.sync.playback.SyncPlaybackInterface(client)
delete(playbackid, **kwargs)
episodes(store=None, **kwargs)
flags = {}
get(media=None, store=None, params=None, query=None, flat=False, **kwargs)
movies(store=None, **kwargs)
shows(store=None, **kwargs)

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']

class trakt.interfaces.sync.watched.SyncWatchedInterface(client)
flags = {'is_watched': True}
get(media=None, store=None, params=None, extended=None, **kwargs)
movies(store=None, **kwargs)
shows(store=None, **kwargs)

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']

class trakt.interfaces.users.UsersInterface(client)
likes(type=None, page=None, per_page=None, **kwargs)

Trakt['users/*/following']

class trakt.interfaces.users.following.UsersFollowingInterface(client)
get(username, extended=None, **kwargs)

Trakt['users/*/friends']

class trakt.interfaces.users.friends.UsersFriendsInterface(client)
get(username, extended=None, **kwargs)

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 (or me)
  • name (str) – Name
  • description (bool) – Description
  • privacy – Privacy (private, friends, or public)
  • 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, or desc)
Returns:

List

Return type:

trakt.objects.CustomList

get(username, **kwargs)

Retrieve lists for user.

Parameters:username (str) – Username (or me)
Returns:List
Return type:trakt.objects.CustomList

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/*/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']

class trakt.interfaces.users.settings.UsersSettingsInterface(client)
get(**kwargs)

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

comment = None
Type:str

Comment body

created_at = None
Type:datetime

Timestamp of when this comment was created

id

Retrieve the comment identifier.

Return type:int
keys = None
Type:list of tuple

Keys (for trakt, imdb, tvdb, etc..), defined as:

..code-block:

[
    (<service>, <id>)
]
liked_at = None
Type:datetime

Timestamp of when this comment was liked

likes = None
Type:int

Number of likes

parent_id = None
Type:int

Parent comment id

pk

Retrieve the primary key (unique identifier for the comment).

Returns:("trakt", <id>) or None if no primary key is available
Return type:tuple
replies = None
Type:int

Number of replies

review = None
Type:bool

Flag indicating this comment is a review

spoiler = None
Type:bool

Flag indicating this comment has a spoiler

user = None
Type:dict

Author details

user_rating = None
Type:float

Author rating for the item

Episode

class trakt.objects.episode.Episode(client, keys=None, index=None)

Bases: trakt.objects.video.Video

available_translations = None
Type:list

Available translations (for title, overview, etc..)

first_aired = None
Type:datetime

First air date

get_key(service)
number_abs = None
Type:int

Absolute episode number

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>) or None if no primary key is available
Return type:tuple
runtime = None
Type:int

Runtime

season = None
Type:trakt.objects.season.Season

Season

show = None
Type:trakt.objects.show.Show

Show

title = None
Type:str

Title

to_dict()

Dump episode to a dictionary.

Returns:Episode dictionary
Return type:dict
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.

updated_at = None
Type:datetime

Updated date/time

List

class trakt.objects.list.base.List(client, keys, user)

Bases: object

allow_comments = None
Type:bool

Flag indicating this list allows comments

comment_count = None
Type:int

Number of comments

created_at = None
Type:datetime

Timestamp of when this list was created

description = None
Type:str

Description

display_numbers = None
Type:bool

Flag indicating this list displays numbers

id

Retrieve the list identifier.

Return type:int
item_count = None
Type:int

Number of items

items(**kwargs)

Retrieve list items.

Parameters:kwargs (dict) – Extra request options
Returns:Current list items
Return type:list of trakt.objects.media.Media
keys = None
Type:list of tuple

Keys (for trakt, imdb, tvdb, etc..), defined as:

..code-block:

[
    (<service>, <id>)
]
like(**kwargs)

Like the list.

Parameters:kwargs (dict) – Extra request options
Returns:Boolean to indicate if the request was successful
Return type:bool
like_count

Retrieve the number of likes.

Return type:int
liked_at = None
Type:datetime

Timestamp of when this list was liked

likes = None
Type:int

Number of likes

name = None
Type:str

Name

pk

Retrieve the primary key (unique identifier for the list).

Returns:("trakt", <id>) or None if no primary key is available
Return type:tuple
privacy = None
Type:str

Privacy

Possible values:
  • private
  • friends
  • public
sort_by = None
Type:str

Sort By

Possible values:
  • rank
  • added
  • title
  • released
  • runtime
  • popularity
  • percentage
  • votes
  • my_rating
  • random
  • watched
  • collected
sort_how = None
Type:str

Sort Direction

Possible values:
  • asc
  • desc
unlike(**kwargs)

Un-like the list.

Parameters:kwargs (dict) – Extra request options
Returns:Boolean to indicate if the request was successful
Return type:bool
updated_at = None
Type:datetime

Timestamp of when this list was last updated

user = None
Type:trakt.objects.User

Author

username

Retrieve author username.

Return type:str

CustomList

class trakt.objects.list.custom.CustomList(client, keys, user)

Bases: trakt.objects.list.base.List

add(items, **kwargs)

Add specified items to the list.

Parameters:
  • items (list) – Items that should be added to the list
  • kwargs (dict) – Extra request options
Returns:

Response

Return type:

dict

delete(**kwargs)

Delete the list.

Parameters:kwargs (dict) – Extra request options
Returns:Boolean to indicate if the request was successful
Return type:bool
id

Retrieve the list identifier.

Return type:int
items(**kwargs)

Retrieve list items.

Parameters:kwargs (dict) – Extra request options
Returns:Current list items
Return type:list of trakt.objects.media.Media
like(**kwargs)

Like the list.

Parameters:kwargs (dict) – Extra request options
Returns:Boolean to indicate if the request was successful
Return type:bool
like_count

Retrieve the number of likes.

Return type:int
pk

Retrieve the primary key (unique identifier for the list).

Returns:("trakt", <id>) or None if no primary key is available
Return type:tuple
remove(items, **kwargs)

Remove specified items from the list.

Parameters:
  • items (list) – Items that should be removed from the list
  • kwargs (dict) – Extra request options
Returns:

Response

Return type:

dict

unlike(**kwargs)

Un-like the list.

Parameters:kwargs (dict) – Extra request options
Returns:Boolean to indicate if the request was successful
Return type:bool
update(**kwargs)

Update the list with the current object attributes.

Parameters:kwargs (dict) – Extra request options
Returns:Boolean to indicate if the request was successful
Return type:bool
username

Retrieve author username.

Return type:str

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)
in_watchlist = None
Type:bool

Flag indicating this item is in your watchlist (or None)

index = None
Type:int

Playlist item index

keys = None
Type:list of tuple

Keys (for imdb, tvdb, etc..), defined as:

..code-block:

[
    (<service>, <id>)
]
last_updated_at = None
Type:datetime

Timestamp of when this item was last updated (or None)

last_watched_at = None
Type:datetime

Timestamp of when this item was last watched (or None)

listed_at = None
Type:datetime

Timestamp of when this item was added to the list (or None)

overview = None
Type:str

Overview (or None)

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>) or None if no primary key is available
Return type:tuple
plays = None
Type:int

Number of plays (or None)

rating = None
Type:int

Community rating (0 - 10) (or None)

reset_at = None
Type:datetime

Timestamp of when this item was reset (or None)

score = None
Type:float

Search score (or None)

Movie

class trakt.objects.movie.Movie(client, keys, index=None)

Bases: trakt.objects.video.Video

available_translations = None
Type:list

Available translations (for title, overview, etc..)

certification = None
Type:str

Content certification (e.g PG-13)

genres = None
Type:list

Genres

get_key(service)
homepage = None
Type:str

Homepage URL

language = None
Type:str

Language (for title, overview, etc..)

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>) or None if no primary key is available
Return type:tuple
released = None
Type:date

Release date

runtime = None
Type:int

Duration (in minutes)

tagline = None
Type:str

Tagline

title = None
Type:str

Title

to_dict()

Dump movie to a dictionary.

Returns:Movie dictionary
Return type:dict
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.

trailer = None
Type:str

Trailer URL

updated_at = None
Type:datetime

Updated date/time

user_count = None
Type:int

Number of user recommendations (returned by the Trakt['movies'].recommended() and Trakt['shows'].recommended() methods)

watchers = None
Type:int

Number of active watchers (returned by the Trakt['movies'].trending() and Trakt['shows'].trending() methods)

year = None
Type:int

Year

Person

class trakt.objects.person.Person(client, keys=None, index=None)

Bases: object

index = None
Type:int

Playlist item index

keys = None
Type:list of tuple

Keys (for imdb, tvdb, etc..), defined as:

..code-block:

[
    (<service>, <id>)
]
listed_at = None
Type:datetime

Timestamp of when this item was added to the list (or None)

name = None
Type:str

Name

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>) or None if no primary key is available
Return type:tuple

BaseProgress

class trakt.objects.progress.BaseProgress(aired=None, completed=None)

Bases: object

aired = None
Type:int

Number of aired episodes

completed = None
Type:int

Number of completed episodes

to_dict()
class trakt.objects.progress.CollectionProgress(client, aired=None, completed=None)

Bases: trakt.objects.progress.Progress

progress_type = 'collection'
to_dict()

Dump progress to a dictionary.

Returns:Progress dictionary
Return type:dict
class trakt.objects.progress.EpisodeProgress(pk=None)

Bases: object

completed = None
Type:bool

Whether or not the episode has been watched or collected

pk = None
Type:int

Episode Number

progress_timestamp = None
Type:datetime

Date/time episode was collected or last watched

to_dict()
class trakt.objects.progress.Progress(client, aired=None, completed=None)

Bases: trakt.objects.progress.BaseProgress

hidden_seasons = None
Type:dict

Hidden Seasons, defined as {season_num: Season}

last_episode = None
Type:trakt.objects.episode.Episode

Last Episode the user watched or collected

last_progress_change = None
Type:datetime

Last watched or collected date/time

next_episode = None
Type:trakt.objects.episode.Episode

Next Episode the user should watch or collect

progress_type = None
Type:str

Progress Type (watched or collection)

reset_at = None
Type:datetime

Reset date/time (not applicable for collected progress)

seasons = None
Type:dict

Season Progress, defined as {season_num: SeasonProgress}

to_dict()

Dump progress to a dictionary.

Returns:Progress dictionary
Return type:dict
class trakt.objects.progress.SeasonProgress(pk=None, aired=None, completed=None)

Bases: trakt.objects.progress.BaseProgress

episodes = None
Type:dict

Episode Progress, defined as {episode_num: EpisodeProgress}

pk = None
Type:int

Season Number

to_dict()
class trakt.objects.progress.WatchedProgress(client, aired=None, completed=None)

Bases: trakt.objects.progress.Progress

progress_type = 'watched'
to_dict()

Dump progress to a dictionary.

Returns:Progress dictionary
Return type:dict

Rating

class trakt.objects.rating.Rating(client, value=None, timestamp=None, votes=None)

Bases: object

timestamp = None
Type:datetime

Rating timestamp

value = None
Type:int

Rating value (0 - 10)

votes = None
Type:int

Number of votes

Season

class trakt.objects.season.Season(client, keys=None, index=None)

Bases: trakt.objects.media.Media

aired_episodes = None
Type:int

Aired episode count

episode_count = None
Type:int

Total episode count

episodes = None
Type:dict

Episodes, defined as {episode_num: Episode}

Note: this field might not be available with some methods

first_aired = None
Type:datetime

First air date

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>) or None if no primary key is available
Return type:tuple
show = None
Type:trakt.objects.show.Show

Show

to_dict()

Dump season to a dictionary.

Returns:Season dictionary
Return type:dict
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

aired_episodes = None
Type:int

Aired episode count

airs = None
Type:dict

Dictionary with day, time and timezone in which the show airs

available_translations = None
Type:list

Available translations (for title, overview, etc..)

certification = None
Type:str

Content certification (e.g TV-MA)

country = None
Type:str

Country in which the show is aired

episodes()

Return a flat episode iterator.

Returns:Iterator ((season_num, episode_num), Episode)
Return type:iterator
first_aired = None
Type:datetime

First air date

genres = None
Type:list

Genres

get_key(service)
homepage = None
Type:str

Homepage URL

language = None
Type:str

Language (for title, overview, etc..)

network = None
Type:str

Network in which the show is aired

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>) or None if no primary key is available
Return type:tuple
runtime = None
Type:int

Duration (in minutes)

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, or ended

title = None
Type:str

Title

to_dict()

Dump show to a dictionary.

Returns:Show dictionary
Return type:dict
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.

updated_at = None
Type:datetime

Updated date/time

user_count = None
Type:int

Number of user recommendations (returned by the Trakt['movies'].recommended() and Trakt['shows'].recommended() methods)

watchers = None
Type:int

Number of active watchers (returned by the Trakt['movies'].trending() and Trakt['shows'].trending() methods)

year = None
Type:int

Year

User

class trakt.objects.user.User(client, keys)

Bases: object

follow(**kwargs)
followed_at = None
Type:datetime

Timestamp of when this user was followed

following(**kwargs)
friends(**kwargs)
friends_at = None
Type:datetime

Timestamp of when this user was friended

history(**kwargs)
id

Retrieve the user identifier.

Return type:int
keys = None
Type:list of tuple

Keys (for trakt, imdb, tvdb, etc..), defined as:

..code-block:

[
    (<service>, <id>)
]
name = None
Type:str

Name

pk

Retrieve the primary key (unique identifier for the user).

Returns:("trakt", <id>) or None if no primary key is available
Return type:tuple
private = None
Type:bool

User profile is private

ratings(**kwargs)
unfollow(**kwargs)
username = None
Type:str

Username

vip = None
Type:bool

User has VIP

vip_ep = None
Type:bool

User has VIP Executive Producer Credit

watchlist(**kwargs)

Video

class trakt.objects.video.Video(client, keys=None, index=None)

Bases: trakt.objects.media.Media

action = None
Type:str

Item action (e.g. history action: “checkin”, “scrobble” or “watch”)

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)

is_collected = None
Type:bool

Flag indicating this item has been collected (or None)

is_watched = None
Type:bool

Flag indicating this item has been watched (or None)

paused_at = None
Type:datetime

Timestamp of when this item was paused (or None)

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>) or None if no primary key is available
Return type:tuple
progress = None
Type:float

Playback progress for item (or None)

watched_at = None
Type:datetime

Timestamp of when this item was watched (or None)

Modules

trakt

class trakt.Trakt

Bases: object

client = <trakt.client.TraktClient object>
classmethod construct()
exception trakt.RequestError(response)

Bases: Exception

exception trakt.ClientError(response)

Bases: trakt.core.exceptions.RequestError

exception trakt.ServerError(response)

Bases: trakt.core.exceptions.RequestError

trakt.client

class trakt.client.TraktClient(adapter_kwargs=None)

Bases: trakt.core.emitter.Emitter

base_url = 'https://api.trakt.tv'
construct(media, item, keys=None, **kwargs)
static get_ids(media, item, parent=None)
site_url
version = '5.0.0.0rc1'

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))
class trakt.core.configuration.ConfigurationManager

Bases: object

app(name=None, version=None, date=None, id=None)
auth(login=None, token=None)
client(id=None, secret=None)
current
get(key, default=None)
http(retry=False, max_retries=3, retry_sleep=5, timeout=(6.05, 24))
class trakt.core.configuration.OAuthConfiguration(owner)

Bases: object

clear()
from_response(response=None, refresh=None, username=None)

trakt.core.context_collection

class trakt.core.context_collection.ContextCollection(base=None)

Bases: object

append(value)
build(ident)
clear()
current
pop(index=None)
class trakt.core.context_collection.ListCollection(*lists)

Bases: object

append(value)
find_list(index)
lists(resolve=True)
pop(index=None)

trakt.core.context_stack

class trakt.core.context_stack.Context(**kwargs)

Bases: object

class trakt.core.context_stack.ContextStack

Bases: object

pop()
push(**kwargs)

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
class trakt.core.emitter.PipeHandler(event, callback)

Bases: object

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)

Bases: trakt.core.exceptions.RequestError

exception trakt.core.exceptions.RequestError(response)

Bases: Exception

exception trakt.core.exceptions.RequestFailedError

Bases: Exception

exception trakt.core.exceptions.ServerError(response)

Bases: trakt.core.exceptions.RequestError

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.pagination

class trakt.core.pagination.PaginationIterator(client, request, exceptions=False)

Bases: object

get(page)
resolve()
with_mapper(mapper)

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
class trakt.interfaces.base.InterfaceProxy(interface, args)

Bases: object

trakt.interfaces.base.application(func)
trakt.interfaces.base.authenticated(func)

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)
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)
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)
class trakt.mapper.ProgressMapper

Bases: trakt.mapper.core.base.Mapper

classmethod progress(client, progress_type, item, **kwargs)
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)
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)
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)
class trakt.mapper.UserMapper

Bases: trakt.mapper.core.base.Mapper

classmethod user(client, item, **kwargs)
classmethod users(client, items, **kwargs)

trakt.mapper.comment

class trakt.mapper.comment.CommentMapper

Bases: trakt.mapper.core.base.Mapper

classmethod comment(client, item, **kwargs)

trakt.mapper.core.base

class trakt.mapper.core.base.Mapper

Bases: object

classmethod construct(client, media, item, keys=None, **kwargs)
static get_ids(media, item, parent=None)

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)

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)

trakt.mapper.progress

class trakt.mapper.progress.ProgressMapper

Bases: trakt.mapper.core.base.Mapper

classmethod progress(client, progress_type, item, **kwargs)

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)

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)

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)

trakt.mapper.user

class trakt.mapper.user.UserMapper

Bases: trakt.mapper.core.base.Mapper

classmethod user(client, item, **kwargs)
classmethod users(client, items, **kwargs)

trakt.objects.core.helpers

trakt.objects.core.helpers.update_attributes(obj, dictionary, keys)

Information

Changelog

4.4.0 (2021-03-19)

Added

  • Interfaces:
    • Trakt['movies'] recommended()
    • Trakt['shows'] recommended()

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
    • 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 provided username parameter.

4.0.0 (2020-05-15)

BREAKING

  • pagination=True now always returns a PaginationIterator with:
    • total_items - Total number of items
    • total_pages - Total number of pages
    • get(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 the page and per_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()
  • Trakt['users/*/lists/*'].items() now supports a media parameter (#76)

3.2.0 (2020-03-17)

Added

  • Exposed episode runtime (#69)
  • Support extended parameter on list items() 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.1 (2017-03-07)

Added

  • __future__ imports to trakt/hooks.py

2.14.0 (2017-03-07)

Added

  • Support for Python 3.6
  • Package version is now automatically written into the trakt.version module on python setup.py egg_info
  • __future__ imports for more consistent Python 3 compatibility
  • SummaryMapper.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 with httmock
  • 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.13.0 (2017-02-16)

Added

  • Trakt['sync/playback'].delete(<id>) method (#54)

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
    • Trakt['search'].query
      • Now supports the fields and extended parameters

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'] and Trakt['shows'] interfaces now support the extended parameter (#51)
  • Minor improvements to property descriptions on the Show and Episode objects

2.10.1 (2016-12-15)

Changed

  • Removed some stray files from the source distribution

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
    • Trakt['sync/watchlist'].get
      • Pagination is now supported, can be enabled with pagination=True
      • media parameter can now be specified as None to return all items (with no type filter)

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 the store parameter
  • Objects:
    • Person
  • Properties:
    • Video.id (history id)
    • Video.watched_at (history timestamp)
  • Methods:
    • Media.get_key(<service>)

2.7.1 (2016-08-30)

Fixed

  • Invalid classifier was defined in [setup.py]

2.7.0 (2016-08-30)

Added

  • Support for multiple media options on the Trakt['search'].query() method
  • Implemented the media parameter on the Trakt['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'] (see examples/authentication/device.py for usage details)
  • Trakt['shows'].seasons() now supports the extended="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 to Trakt['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 to Movie, Show, Season and Episode objects (#45)
  • Trakt.site_url setter to override automatic detection
  • HttpClient now supports direct calls (#43)

Changed

  • Tests are now included in builds, but are excluded from installations

2.5.1 (2015-09-25)

Fixed

  • Issue installing trakt.py when “six” hasn’t been installed yet

2.5.0 (2015-09-24)

Added

  • Trakt['users'].likes() method
  • CustomList.items() method
  • Comment object
  • Media.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 in SummaryMapper 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 to Trakt['shows'] and Trakt['movies'] interfaces (#23)
  • seasons() and episodes() methods to the Trakt['sync/watchlist'] interface (#26)
  • Custom lists support (Trakt['users/*/lists'], Trakt['users/*/lists/*']) (#26)
  • __eq__() method on the Rating class
  • proxies attribute on Trakt.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 parameters
  • Trakt['oauth'].token() method has been renamed to Trakt['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 a KeyError: '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.