Skip to main content

A simple wrapper for the TMDb API.

Project description

Python wrapper for The Movie Database (TMDb) API.

To use this wrapper you will need to get an API key from TMDb.

Check out the API documentation:

Install

pip install tmdbv3api

Examples

Get the list of popular movies on The Movie Database. This list refreshes every day.

from tmdbv3api import TMDb
tmdb = TMDb(api_key="your_api_key", debug=False, lang="en")

popular = tmdb.popular()

for movie in popular:
    print movie.id
    print movie.title
    print movie.overview
    print movie.poster_path

Get the primary information about a movie.

movie = tmdb.get_movie(343611)
print movie.title
print movie.overview
print movie.popularity

Search for movies by title.

search = tmdb.search('Mad Max')

for movie in search:
    print movie.id
    print movie.title
    print movie.overview
    print movie.poster_path
    print movie.vote_average

Get the similar movies for a specific movie id.

similar = tmdb.similar(777)

for result in similar:
    print result.title
    print result.overview

Search for TV shows by title.

show = tmdb.search_tv('Breaking Bad')

for result in show:
    print result.name
    print result.overview

Get the similar TV shows for a specific tv id.

similar = tmdb.similar_shows(1396)

for show in similar:
    print show.name
    print show.overview

Get the general person information for a specific id.

person = tmdb.get_person(12)

print person.name
print person.biography

Discover movies by different types of data like average rating, number of votes, genres and certifications.

# What movies are in theatres?

movie = tmdb.discover_movies({
    'primary_release_date.gte': '2017-01-20',
    'primary_release_date.lte': '2017-01-25'
})

# What are the most popular movies?

movie = tmdb.discover_movies({
    'sort_by': 'popularity.desc'
})

# What are the most popular kids movies?

movie = tmdb.discover_movies({
    'certification_country': 'US',
    'certification.lte': 'G',
    'sort_by': 'popularity.desc'
})

Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates.

# What are the most popular TV shows?

show = tmdb.discover_tv_shows({
    'sort_by': 'popularity.desc'
})

# What are the best dramas?

show = tmdb.discover_tv_shows({
    'with_genres': 18,
    'sort_by': 'vote_average.desc',
    'vote_count.gte': 10
})

Supported Methods

Movies

  • /movie/latest

  • /movie/now_playing

  • /movie/top_rated

  • /movie/upcoming

  • /movie/id

  • /movie/id/similar

  • /movie/id/recommendations

  • /movie/id/videos

  • /movie/id/reviews

  • /movie/id/lists

TV

  • /tv/id

  • /tv/latest

  • /tv/id/similar

  • /tv/top_rated

  • /tv/popular

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tmdbv3api-0.4.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distributions

tmdbv3api-0.4-py2.py3-none-any.whl (10.3 kB view hashes)

Uploaded Python 2 Python 3

tmdbv3api-0.4-py2-none-any.whl (6.1 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page