A simple python3 wrapper over themoviedb.org API
pip install pymoviedb
>>> from pymoviedb import Movie, TvShows
>>> APIKEY = "you-api-key"
# Create a Movie object
>>> mv = Movie(APIKEY)
# search for queries
>>> mv.search("Titanic")
# search using id
>>> mv.searchid(597)
# Get trending movies for "day" or "week"
# by default it's "week"
>>> mv.trending("day")
# Get recommendations by id
>>> mv.recommendations(597)
# Similarly for tvshows
>>> tv = TvShows(APIKEY)
>>> tv.search("Breaking bad")
# All methods can be found by using dir() function
>>> print(dir(Movie))
Exceptions can be imported from pymoviedb.excs
for easy error handling.
Example:
from pymoviedb.excs import ZeroResultsFound
tv = TvShows(APIKEY)
try:
print(tv.search("xsxsxsx"))
except ZeroResultsFound:
print("Nothing found!")
TMDB API docs: https://developers.themoviedb.org/3/
This library is being used by my telegram bot αcutєвσt, Check that out to see live working example!
Remember that this module not support all TMDB API methods yet.
This module is licensed under the MIT license. See LICENSE file for more details.