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 details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

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

Uploaded Python 2

File details

Details for the file tmdbv3api-0.4.tar.gz.

File metadata

  • Download URL: tmdbv3api-0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tmdbv3api-0.4.tar.gz
Algorithm Hash digest
SHA256 987060f2888523be08bd7d7a087addc36b02cedfb0c78de57605391c42bf6b35
MD5 b3568719739563a082d4abf6a11886c4
BLAKE2b-256 0b7608df89b749cc51556d2a7619685e0c2e0df30f37ecb688e6fc7b1413f735

See more details on using hashes here.

File details

Details for the file tmdbv3api-0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tmdbv3api-0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ade206f75afa1d3cc5dfeb9fe9340bc22404a6de5466496f7cae482b9b3f2255
MD5 33680237416a27102b41744ef29494a5
BLAKE2b-256 09031510e3e329aaf3655d5e006a386fb3d02712803b6b92c16d15dc57b290fe

See more details on using hashes here.

File details

Details for the file tmdbv3api-0.4-py2-none-any.whl.

File metadata

File hashes

Hashes for tmdbv3api-0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 6963a03300b709b004d4562d3fde5ddb8060757e6a022a7a6fa62f2197cd1e20
MD5 409e921bb56338b5d81d0af138cb36e3
BLAKE2b-256 81b1c8acdea90e715d88bc1d517412d9b5f95ff165f039e09dc482a65037d949

See more details on using hashes here.

Supported by

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