Package: rtsimple
A wrapper for the Rotten Tomatoes APIrtsimpleis a wrapper, written in Python, for the Rotten Tomatoes (RT) API.  By calling the methods available inrtsimpleyou can simplify your code and easily access a vast amount of movie data, including detailed movie information, lists of new released movies and dvds, critic and audience scores, and published reviews.  To find out more about the Rotten Tomatoes API, check out the Welcome pagehttp://developer.rottentomatoes.comand Overview pagehttp://developer.rottentomatoes.com/docs.FeaturesSupports and tested under Python 2.7.6, 3.3.5, and 3.4.0One-to-one mapping betweenrtsimpleand RT methods.Implements all RT methods.Easy to access data using Python class attributes.Easy to experiment withrtsimplemethods inside the Python interpreter.Code tested with unittests, which illustrate the method call syntax.Installationrtsimpleis available on the Python Package Index (PyPI) athttps://pypi.python.org/pypi/rtsimple.You can installrtsimpleusing one of the following techniques.Use pip:pip install rtsimpleDownload the .zip or .tar.gz file from PyPI and install it yourselfDownload thesource from Githuband install it yourselfIf you install it yourself, also installrequests.API KeyYou will need an API key to Rotten Tomatoes to access the API.  To obtain a key, follow these steps:Register for and verify anaccount.Log intoyour account.Once you are logged in, click on the link toApply for an API keyand follow the instructions.ExamplesWith thertsimplepackage installed and an RT API key, you can start to play with the data.First, import the package and assign your API_KEY.>>>importrtsimpleasrt>>>rt.API_KEY='YOUR API KEY HERE'To communicate with the Rotten Tomatoes (RT) API, create an instance of one of the object types, call one of the methods on the instance, and access instance attributes.  Use keys to access attribute values that are dictionaries.  In this example, we search for movies withHunger Gamesin the title, and determine the Rotten Tomatoes id of the second installment in the series, Catching Fire.>>>movie=rt.Movies()>>>response=movie.search(q="Hunger Games")>>>len(movie.movies)4>>>forminmovie.movies:...print(m['title'])...TheHungerGamesTheHungerGames:CatchingFireTheHungerGames:Mockingjay-Part1TheHungerGames:Mockingjay-Part2>>>movie.movies[1]['id']'771250004'Once we have the RT id, we can create a movie instance to represent that movie specifically and examine its attributes.>>>movie=rt.Movies('771250004')>>>response=movie.info()>>>movie.title'The Hunger Games: Catching Fire'>>>movie.mpaa_rating'PG-13'>>>movie.genres['Action & Adventure','Science Fiction & Fantasy']>>>movie.runtime146>>>movie.ratings['critics_score']89>>>movie.ratings['audience_score']92For fun, get ratings for the otherHunger Gamesmovies and determine which of the movies is considered by critics to be the best in the series.Call other instance methods to gather additional information.  In this example, we find movies that are considered similar toThe Hunger Games: Catching Fire.  On the list are the original movie, which isn’t too surprising, and one of the Harry Potter movies, which is a surprise.>>>response=movie.similar()>>>len(movie.movies)2>>>forminmovie.movies:...print(m['title'])...TheHungerGamesHarryPotterandtheDeathlyHallows-Part1In addition to extracting detailed information about specific movies, you can get movie and DVD lists from the Rotten Tomatoes API.  Suppose you are curious whether theMovies In Theaterslist has any movies in common with theDVDs Upcominglist.  Note that the RT API lists are updated on a regular basis, so your results may vary from those below.>>>lst=rt.Lists()>>>response=lst.movies_in_theaters()>>>lst.total127>>>forminlst.movies[:5]:...print(m['title'])...TheLegendofHerculesTheHobbit:TheDesolationOfSmaugFrozenLoneSurvivorAnchorman2:TheLegendContinues>>>response=lst.dvds_upcoming()>>>lst.total72>>>forminlst.movies[:5]:...print(m['title'])...RiddickCarrieLeeDaniels' The ButlerEnoughSaidYou're NextFor the first 5 entries, there doesn’t appear to be any overlap.  For fun, create complete lists of theMovies In Theaterslist andDVDs Upcominglist and determine if the lists overlap at all.Note that you can call methods and get details without explicitly instanciating an object.>>>response=rt.Movies(771250004).info()>>>response['alternate_ids']{'imdb':'1951264'}If you like this wrapper, and would like access to even more movie and TV data, check outtmdbsimplehttps://pypi.python.org/pypi/tmdbsimple, a wrapper for The Movie Database API v3.