Pagination Objects
- class TMDbPagination(tmdb, data, value_type, page_type)[source]
Bases:
TMDbObj
Represents a Pagination Object. The standard iterator only loops through the current page.
- Variables:
page (int) – Current Page.
results (int) – Current Page’s Results.
total_pages (int) – Total Pages.
total_results (int) – Total Results.
- load_next()[source]
Loads the next page of the Paginated Object.
- Returns:
List of Movies that changed.
- Return type:
List[
Movie
]- Raises:
Invalid – When
start_date
orend_date
is in an incorrect format.
- load_page(page: int)[source]
Loads the page of the Paginated Object.
- Parameters:
page (int) – page number to load.
- Raises:
Invalid – When
page
is not in the range of valid page numbers.
- get_results(amount: int | None = None)[source]
Gets the amount of results asked for from multiple pages. This method can make alot of calls to the API if you’re not careful.
- Parameters:
amount (Optional[int]) – Amount of Items you want returned.
- Raises:
Invalid – When
amount
is not greater than zero.
- class CreatedLists(tmdb, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of the lists created by an account. Will include private lists if you are the owner.
- class DiscoverMovies(tmdb, **kwargs)[source]
Bases:
TMDbPagination
Paginated Object of the Movie Discover search results.
- class DiscoverTVShows(tmdb, **kwargs)[source]
Bases:
TMDbPagination
Paginated Object of the TV Discover search results.
- class FavoriteMovies(tmdb, sort_by=None, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of your favorite movies.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class FavoriteTVShows(tmdb, sort_by=None, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of your favorite TV shows.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class RatedEpisodes(tmdb, sort_by=None)[source]
Bases:
TMDbPagination
Paginated Object of the TV episodes you have rated.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class RatedMovies(tmdb, sort_by=None, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of the movies you have rated.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class RatedTVShows(tmdb, sort_by=None, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of the TV shows you have rated.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class MovieLists(tmdb, data, movie_id)[source]
Bases:
TMDbPagination
Paginated Object of the lists that this movie belongs to.
- Variables:
movie_id (int) – Movie ID referenced by this Paginated Object.
- class MovieRecommendations(tmdb, sort_by=None)[source]
Bases:
TMDbPagination
Paginated Object of your personal movie recommendations.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class MovieReviews(tmdb, data, movie_id)[source]
Bases:
TMDbPagination
Paginated Object of user reviews for a movie.
- Variables:
movie_id (int) – Movie ID referenced by this Paginated Object.
- class MovieWatchlist(tmdb, sort_by=None, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of the movies you have added to your watchlist.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class NowPlayingMovies(tmdb, region=None)[source]
Bases:
TMDbPagination
Paginated Object of movies in theatres.
- Variables:
region (str) – ISO 3166-1 code used to filter release dates.
maximum_date (datetime) – Maximum Date.
minimum_date (datetime) – Minimum Date.
- class PopularMovies(tmdb, region=None)[source]
Bases:
TMDbPagination
Paginated Object of the current popular movies on TMDB.
- Variables:
region (str) – ISO 3166-1 code used to filter release dates.
- class PopularPeople(tmdb)[source]
Bases:
TMDbPagination
Paginated Object of the list of popular people on TMDB.
- class PopularTVShows(tmdb)[source]
Bases:
TMDbPagination
Paginated Object of the current popular TV shows on TMDB.
- class RecommendedMovies(tmdb, data, movie_id)[source]
Bases:
TMDbPagination
Paginated Object of recommended movies for a movie.
- Variables:
movie_id (int) – Movie ID referenced by this Paginated Object.
- class RecommendedTVShows(tmdb, data, tv_id)[source]
Bases:
TMDbPagination
Paginated Object of recommended TV shows for a TV show.
- Variables:
tv_id (int) – TV ID referenced by this Paginated Object.
- class SearchCollections(tmdb, query)[source]
Bases:
TMDbPagination
Paginated Object of the Collections Search Results.
- Variables:
query (str) – Query of the search.
- class SearchCompanies(tmdb, query)[source]
Bases:
TMDbPagination
Paginated Object of the Companies Search Results.
- Variables:
query (str) – Query of the search.
- class SearchKeywords(tmdb, query)[source]
Bases:
TMDbPagination
Paginated Object of the Keywords Search Results.
- Variables:
query (str) – Query of the search.
- class SearchMovies(tmdb, query, include_adult=None, region=None, year=None, primary_release_year=None)[source]
Bases:
TMDbPagination
Paginated Object of the Movies Search Results.
- Variables:
query (str) – Query of the search.
include_adult (bool) – Adult results in the search.
region (str) – ISO 3166-1 code used to filter the search.
year (int) – Year used to filter the search.
primary_release_year (int) – Primary Release Year used to filter the search.
- class SearchMulti(tmdb, query, include_adult=None, region=None)[source]
Bases:
TMDbPagination
Paginated Object of the Multi Search Results.
- Variables:
query (str) – Query of the search.
include_adult (bool) – Adult results in the search.
region (str) – ISO 3166-1 code used to filter the search.
- class SearchPeople(tmdb, query, include_adult=None, region=None)[source]
Bases:
TMDbPagination
Paginated Object of the People Search Results.
- Variables:
query (str) – Query of the search.
include_adult (bool) – Adult results in the search.
region (str) – ISO 3166-1 code used to filter the search.
- class SearchTVShows(tmdb, query, include_adult=None, first_air_date_year=None)[source]
Bases:
TMDbPagination
Paginated Object of the TV Show Search Results.
- Variables:
query (str) – Query of the search.
include_adult (bool) – Adult results in the search.
first_air_date_year (int) – First Air Date Year used to filter the search.
- class SimilarMovies(tmdb, data, movie_id)[source]
Bases:
TMDbPagination
Paginated Object of similar movies for a movie.
- Variables:
movie_id (int) – Movie ID referenced by this Paginated Object.
- class SimilarTVShows(tmdb, data, tv_id)[source]
Bases:
TMDbPagination
Paginated Object of similar TV shows for a TV show.
- Variables:
tv_id (int) – TV ID referenced by this Paginated Object.
- class TaggedImages(tmdb, data, person_id)[source]
Bases:
TMDbPagination
Paginated Object of tagged images for a person.
- Variables:
person_id (int) – Person ID referenced by this Paginated Object.
- class TMDbList(tmdb, data, sort_by=None, load=False)[source]
Bases:
TMDbPagination
Paginated Object of the items in a list.
- Variables:
average_rating (float) – Average Rating of the items in the List. (v4 Only)
backdrop_path (str) – List backdrop path. (v4 Only)
backdrop_url (str) – List full backdrop url. (v4 Only)
comments (Dict[str, str]) – Dictionary of the comment for each item. (v4 Only)
country (
Country
) – Country object for the ISO 3166-1 Country Code. (v4 Only)created_by (Union[str,
User
]) – User who created the list (str for v3 andUser
for v4).description (str) – List Description.
favorite_count (int) – Number of users who have marked this list as a favorite. (v3 Only)
id (int) – List ID.
iso_3166_1 (str) – ISO 3166-1 Alpha-2 Country Code of the List. (v4 Only)
iso_639_1 (str) – ISO 639-1 Language Code of the List.
language (
Language
) – Language object for the ISO 639-1 Language Code.name (int) – List Name.
object_ids (Dict[str, str]) – Dictionary of the object ids for each item. (v4 Only)
poster_path (str) – List poster path.
poster_url (str) – List full poster url.
public (bool) – List Public. (v4 Only)
revenue (int) – Total revenue of the items in the List. (v4 Only)
runtime (int) – Total runtime of the items in the List. (v4 Only)
sort_by (str) – How the List is sorted. (v4 Only)
- update(name: str | None = None, description: str | None = None, public: bool | None = None, sort_by: str | None = None)[source]
Updates the list’s metadata.
- Parameters:
name (Optional[str]) – Updates the list name.
description (Optional[str]) – Updates the list description.
public (Optional[bool]) – Updates whether the list is public.
sort_by (Optional[str]) – Updates the list sort_by.
- Raises:
Invalid – When no attribute is given or the
sort_by
given is invalid.
- has_item(item: Movie | TVShow | Tuple[int, str]) bool [source]
Check to see if the Item given is in the List.
- Parameters:
item (Union[Movie, TVShow, Tuple[int, str]]) – Item you want to check if it’s on the list. If not using a Movie or Show object then you must use a Tuple with the ID and either
movie
ortv
.- Raises:
Invalid – When the item given isn’t in a valid format.
- Returns:
Whether the list has the Item or not.
- Return type:
bool
- add_items(items: List[Movie | TVShow | Tuple[int, str]])[source]
Adds the items given to the list.
- Parameters:
items (List[Union[Movie, TVShow, Tuple[int, str]]]) – Items you want to add to the list. If not using a Movie or Show object then you must use a Tuple with the ID and either
movie
ortv
.- Raises:
Invalid – When the item given isn’t in a valid format.
- Returns:
Whether the list has the Item or not.
- Return type:
bool
- remove_items(items: List[Movie | TVShow | Tuple[int, str]])[source]
Adds the items given to the list.
- update_items(items: List[Tuple[Movie | TVShow | Tuple[int, str], str]])[source]
Updates the items on the list.
- Parameters:
items (List[Tuple[Union[Movie, TVShow, Tuple[int, str]], str]]) – Tuples of the items you want updated on the list and their description. If not using a Movie or Show object then you must use a Tuple of the ID and either
movie
ortv
.- Raises:
Invalid – When the item given isn’t in a valid format.
- class TopRatedMovies(tmdb, region=None)[source]
Bases:
TMDbPagination
Paginated Object of the top rated movies on TMDB.
- Variables:
region (str) – ISO 3166-1 code used to filter release dates.
- class TopRatedTVShows(tmdb)[source]
Bases:
TMDbPagination
Paginated Object of the top rated TV shows on TMDB.
- class Trending(tmdb, media_type, time_window)[source]
Bases:
TMDbPagination
Paginated Object of daily or weekly trending items.
- Variables:
media_type (str) – Media type of the Paginated Object.
time_window (str) – Time Window for the Trending.
- class TVShowRecommendations(tmdb, sort_by=None)[source]
Bases:
TMDbPagination
Paginated Object of your personal TV show recommendations.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class TVShowsAiringToday(tmdb)[source]
Bases:
TMDbPagination
Paginated Object of TV shows that are airing today.
- class TVShowsOnTheAir(tmdb)[source]
Bases:
TMDbPagination
Paginated Object of shows that are currently on the air.
- class TVShowWatchlist(tmdb, sort_by=None, v3=False)[source]
Bases:
TMDbPagination
Paginated Object of the TV shows you have added to your watchlist.
- Variables:
sort_by (str) – How the paginated object is sorted.
- class UpcomingMovies(tmdb, region=None)[source]
Bases:
TMDbPagination
Paginated Object of upcoming movies in theatres.
- Variables:
maximum_date (datetime) – Maximum Date.
minimum_date (datetime) – Minimum Date.