[Python-modules-commits] [python-tmdbsimple] 01/01: New upstream version 1.8.0

Michael Fladischer fladi at moszumanska.debian.org
Tue Oct 31 09:33:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch upstream
in repository python-tmdbsimple.

commit a54c2ec2a314f47def28037d2bc1ed63517944df
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Tue Oct 31 09:19:50 2017 +0100

    New upstream version 1.8.0
---
 setup.py                    |   6 +-
 tests/test_movies.py        |  13 +++++
 tests/test_people.py        |   2 +-
 tests/test_tv.py            |  26 +++++----
 tmdbsimple/__init__.py      |   6 +-
 tmdbsimple/account.py       |   8 +--
 tmdbsimple/base.py          |   7 ++-
 tmdbsimple/changes.py       |   2 +-
 tmdbsimple/configuration.py |   6 +-
 tmdbsimple/discover.py      |   2 +-
 tmdbsimple/find.py          |   2 +-
 tmdbsimple/genres.py        |   2 +-
 tmdbsimple/movies.py        | 136 ++++++++++++++++++++++++--------------------
 tmdbsimple/people.py        |   6 +-
 tmdbsimple/search.py        |   2 +-
 tmdbsimple/tv.py            |  83 ++++++++++++++++-----------
 16 files changed, 181 insertions(+), 128 deletions(-)

diff --git a/setup.py b/setup.py
index 83ce203..431ccd5 100644
--- a/setup.py
+++ b/setup.py
@@ -11,17 +11,17 @@ def read(fname):
 # requests[security]: http://stackoverflow.com/questions/29134512/insecureplatformwarning-a-true-sslcontext-object-is-not-available-this-prevent/29202163#29202163
 setup(
     name = 'tmdbsimple',
-    version = '1.7.0',
+    version = '1.8.0',
     author = 'Celia Oakley',
     author_email = 'celia.oakley at alumni.stanford.edu',
     description = 'A Python wrapper for The Movie Database API v3',
     keywords = ['movie', 'the movie database', 'movie database', 'tmdb', 
                 'wrapper', 'database', 'themoviedb', 'moviedb', 'api'],
     url = 'https://github.com/celiao/tmdbsimple',
-    download_url = 'https://github.com/celiao/tmdbsimple/tarball/1.7.0',
+    download_url = 'https://github.com/celiao/tmdbsimple/tarball/1.8.0',
     packages = ['tmdbsimple'],
     long_description=read('README.rst'),
-    install_requires = ['requests[security]'],
+    install_requires = ['requests'],
     classifiers = [
         "Development Status :: 5 - Production/Stable",
         "Intended Audience :: Developers",
diff --git a/tests/test_movies.py b/tests/test_movies.py
index 7291d1d..c3f9eba 100644
--- a/tests/test_movies.py
+++ b/tests/test_movies.py
@@ -78,6 +78,19 @@ class MoviesTestCase(unittest.TestCase):
         movie = tmdb.Movies(id)
         response = movie.keywords()
         self.assertTrue(hasattr(movie, 'keywords'))
+        # Confirm we can call keywords() again without error
+        raised = False
+        try:
+            movie.keywords()
+        except:
+            raised = True
+        self.assertFalse(raised)
+
+    def test_movies_release_dates(self):
+        id = MOVIE_ID
+        movie = tmdb.Movies(id)
+        response = movie.release_dates()
+        self.assertTrue(hasattr(movie, 'results'))
 
     def test_movies_releases(self):
         id = MOVIE_ID
diff --git a/tests/test_people.py b/tests/test_people.py
index 383cbe4..7401636 100644
--- a/tests/test_people.py
+++ b/tests/test_people.py
@@ -79,7 +79,7 @@ class PeopleTestCase(unittest.TestCase):
     def test_people_latest(self):
         person = tmdb.People()
         response = person.latest()
-        self.assertTrue(hasattr(person, 'birthday'))
+        self.assertTrue(hasattr(person, 'name'))
 
 
 class CreditsTestCase(unittest.TestCase):
diff --git a/tests/test_tv.py b/tests/test_tv.py
index c05e0b4..f091de3 100644
--- a/tests/test_tv.py
+++ b/tests/test_tv.py
@@ -56,6 +56,12 @@ class TVTestCase(unittest.TestCase):
         response = tv.alternative_titles()
         self.assertTrue(hasattr(tv, 'results'))
 
+    def test_tv_content_ratings(self):
+        id = TV_ID
+        tv = tmdb.TV(id)
+        response = tv.content_ratings()
+        self.assertTrue(hasattr(tv, 'results'))
+
     def test_tv_credits(self):
         id = TV_ID
         tv = tmdb.TV(id)
@@ -134,39 +140,39 @@ class TVTestCase(unittest.TestCase):
 
 class TVSeasonsTestCase(unittest.TestCase):
     def test_tv_seasons_info(self):
-        id = TV_SEASON_ID
+        series_id = TV_SEASON_ID
         season_number = TV_SEASON_NUMBER
         name = TV_SEASON_NAME
-        tv_seasons = tmdb.TV_Seasons(id, season_number)
+        tv_seasons = tmdb.TV_Seasons(series_id, season_number)
         response = tv_seasons.info()
         self.assertEqual(tv_seasons.name, name)
 
     def test_tv_seasons_credits(self):
-        id = TV_SEASON_ID
+        series_id = TV_SEASON_ID
         season_number = TV_SEASON_NUMBER
-        tv_seasons = tmdb.TV_Seasons(id, season_number)
+        tv_seasons = tmdb.TV_Seasons(series_id, season_number)
         response = tv_seasons.credits()
         self.assertTrue(hasattr(tv_seasons, 'crew'))
 
     def test_tv_seasons_external_ids(self):
-        id = TV_SEASON_ID
+        series_id = TV_SEASON_ID
         season_number = TV_SEASON_NUMBER
         tvdb_id = TV_SEASON_TVDB_ID
-        tv_seasons = tmdb.TV_Seasons(id, season_number)
+        tv_seasons = tmdb.TV_Seasons(series_id, season_number)
         response = tv_seasons.external_ids()
         self.assertEqual(tv_seasons.tvdb_id, tvdb_id)
 
     def test_tv_seasons_images(self):
-        id = TV_SEASON_ID
+        series_id = TV_SEASON_ID
         season_number = TV_SEASON_NUMBER
-        tv_seasons = tmdb.TV_Seasons(id, season_number)
+        tv_seasons = tmdb.TV_Seasons(series_id, season_number)
         response = tv_seasons.images()
         self.assertTrue(hasattr(tv_seasons, 'posters'))
 
     def test_tv_seasons_videos(self):
-        id = TV_SEASON_ID
+        series_id = TV_SEASON_ID
         season_number = TV_SEASON_NUMBER
-        tv_seasons = tmdb.TV_Seasons(id, season_number)
+        tv_seasons = tmdb.TV_Seasons(series_id, season_number)
         response = tv_seasons.videos()
         self.assertTrue(hasattr(tv_seasons, 'results'))
 
diff --git a/tmdbsimple/__init__.py b/tmdbsimple/__init__.py
index 4e4b451..603cca8 100644
--- a/tmdbsimple/__init__.py
+++ b/tmdbsimple/__init__.py
@@ -9,7 +9,7 @@ API v3.  By calling the functions available in *tmdbsimple* you can simplify
 your code and easily access a vast amount of movie, tv, and cast data.  To find 
 out more about The Movie Database API, check out the overview page 
 http://www.themoviedb.org/documentation/api and documentation page 
-http://docs.themoviedb.apiary.io.
+https://developers.themoviedb.org/3/getting-started
 https://www.themoviedb.org/documentation/api/status-codes
 
 :copyright: (c) 2013-2017 by Celia Oakley.
@@ -17,9 +17,9 @@ https://www.themoviedb.org/documentation/api/status-codes
 """
 
 __title__ = 'tmdbsimple'
-__version__ = '1.7.0'
+__version__ = '1.8.0'
 __author__ = 'Celia Oakley'
-__copyright__ = 'Copyright (c) 2013-1017 Celia Oakley'
+__copyright__ = 'Copyright (c) 2013-2017 Celia Oakley'
 __license__ = 'GPLv3'
 
 import os
diff --git a/tmdbsimple/account.py b/tmdbsimple/account.py
index 526f9d5..caa24eb 100644
--- a/tmdbsimple/account.py
+++ b/tmdbsimple/account.py
@@ -19,7 +19,7 @@ class Account(TMDB):
     """
     Account functionality.
 
-    See: http://docs.themoviedb.apiary.io/#account
+    See: https://developers.themoviedb.org/3/account
          https://www.themoviedb.org/documentation/api/sessions
     """
     BASE_PATH = 'account'
@@ -243,7 +243,7 @@ class Authentication(TMDB):
     """
     Authentication functionality.
 
-    See: http://docs.themoviedb.apiary.io/#authentication
+    See: https://developers.themoviedb.org/3/authentication
          https://www.themoviedb.org/documentation/api/sessions
     """
     BASE_PATH = 'authentication'
@@ -332,7 +332,7 @@ class GuestSessions(TMDB):
     """
     Guest Sessions functionality.
 
-    See: http://docs.themoviedb.apiary.io/#guestsessions
+    See: https://developers.themoviedb.org/3/guest-sessions
     """
     BASE_PATH = 'guest_session'
     URLS = {
@@ -366,7 +366,7 @@ class Lists(TMDB):
     """
     Lists functionality.
 
-    See: http://docs.themoviedb.apiary.io/#lists
+    See: https://developers.themoviedb.org/3/lists
     """
     BASE_PATH = 'list'
     URLS = {
diff --git a/tmdbsimple/base.py b/tmdbsimple/base.py
index d6a41e6..4cccc19 100644
--- a/tmdbsimple/base.py
+++ b/tmdbsimple/base.py
@@ -44,8 +44,8 @@ class TMDB(object):
     def _get_credit_id_path(self, key):
         return self._get_path(key).format(credit_id=self.credit_id)
 
-    def _get_id_season_number_path(self, key):
-        return self._get_path(key).format(id=self.id,
+    def _get_series_id_season_number_path(self, key):
+        return self._get_path(key).format(series_id=self.series_id,
             season_number=self.season_number)
 
     def _get_series_id_season_number_episode_number_path(self, key):
@@ -102,5 +102,6 @@ class TMDB(object):
         """
         if isinstance(response, dict):
             for key in response.keys():
-                setattr(self, key, response[key])
+                if not hasattr(self, key):
+                    setattr(self, key, response[key])
 
diff --git a/tmdbsimple/changes.py b/tmdbsimple/changes.py
index b084e1c..a789dd6 100644
--- a/tmdbsimple/changes.py
+++ b/tmdbsimple/changes.py
@@ -17,7 +17,7 @@ class Changes(TMDB):
     """
     Changes functionality.
 
-    See: http://docs.themoviedb.apiary.io/#changes
+    See: https://developers.themoviedb.org/3/changes
     """
     BASE_PATH = ''
     URLS = {
diff --git a/tmdbsimple/configuration.py b/tmdbsimple/configuration.py
index 5afa1e3..c899452 100644
--- a/tmdbsimple/configuration.py
+++ b/tmdbsimple/configuration.py
@@ -20,7 +20,7 @@ class Configuration(TMDB):
     """
     Configuration functionality.
 
-    See: http://docs.themoviedb.apiary.io/#configuration
+    See: https://developers.themoviedb.org/3/configuration
     """
     BASE_PATH = 'configuration'
     URLS = {
@@ -45,7 +45,7 @@ class Certifications(TMDB):
     """
     Certifications functionality.
 
-    See: http://docs.themoviedb.apiary.io/#certifications
+    See: https://developers.themoviedb.org/3/certifications
     """
     BASE_PATH = 'certification'
     URLS = {
@@ -70,7 +70,7 @@ class Timezones(TMDB):
     """
     Timezones functionality.
 
-    See: http://docs.themoviedb.apiary.io/#timezones
+    See: https://developers.themoviedb.org/3/timezones
     """
     BASE_PATH = 'timezones'
     URLS = {
diff --git a/tmdbsimple/discover.py b/tmdbsimple/discover.py
index 28ac8dd..95652ea 100644
--- a/tmdbsimple/discover.py
+++ b/tmdbsimple/discover.py
@@ -17,7 +17,7 @@ class Discover(TMDB):
     """
     Discover functionality.
 
-    See: http://docs.themoviedb.apiary.io/#discover
+    See: https://developers.themoviedb.org/3/discover
     """
     BASE_PATH = 'discover'
     URLS = {
diff --git a/tmdbsimple/find.py b/tmdbsimple/find.py
index 015ae2c..7e51741 100644
--- a/tmdbsimple/find.py
+++ b/tmdbsimple/find.py
@@ -17,7 +17,7 @@ class Find(TMDB):
     """
     Find functionality.
 
-    See: http://docs.themoviedb.apiary.io/#find
+    See: https://developers.themoviedb.org/3/find
     """
     BASE_PATH = 'find'
     URLS = {
diff --git a/tmdbsimple/genres.py b/tmdbsimple/genres.py
index 67768d4..5ac6a62 100644
--- a/tmdbsimple/genres.py
+++ b/tmdbsimple/genres.py
@@ -18,7 +18,7 @@ class Genres(TMDB):
     """
     Genres functionality.
 
-    See: http://docs.themoviedb.apiary.io/#genres
+    See: https://developers.themoviedb.org/3/genres
     """
     BASE_PATH = 'genre'
     URLS = {
diff --git a/tmdbsimple/movies.py b/tmdbsimple/movies.py
index e725c6a..18cb3e2 100644
--- a/tmdbsimple/movies.py
+++ b/tmdbsimple/movies.py
@@ -3,7 +3,7 @@
 """
 tmdbsimple.movies
 ~~~~~~~~~~~~~~~~~
-This module implements the Movies, Collections, Companies, Keywords, and 
+This module implements the Movies, Collections, Companies, Keywords, and
 Reviews functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
@@ -18,7 +18,7 @@ class Movies(TMDB):
     """
     Movies functionality.
 
-    See: http://docs.themoviedb.apiary.io/#movies
+    See: https://developers.themoviedb.org/3/movies
     """
     BASE_PATH = 'movie'
     URLS = {
@@ -27,6 +27,7 @@ class Movies(TMDB):
         'credits': '/{id}/credits',
         'images': '/{id}/images',
         'keywords': '/{id}/keywords',
+        'release_dates': '/{id}/release_dates',
         'releases': '/{id}/releases',
         'videos': '/{id}/videos',
         'translations': '/{id}/translations',
@@ -50,7 +51,7 @@ class Movies(TMDB):
     def info(self, **kwargs):
         """
         Get the basic movie information for a specific movie id.
-        
+
         Args:
             language: (optional) ISO 639-1 code.
             append_to_response: (optional) Comma separated, any movie method.
@@ -67,7 +68,7 @@ class Movies(TMDB):
     def alternative_titles(self, **kwargs):
         """
         Get the alternative titles for a specific movie id.
-        
+
         Args:
             country: (optional) ISO 3166-1 code.
             append_to_response: (optional) Comma separated, any movie method.
@@ -84,7 +85,7 @@ class Movies(TMDB):
     def credits(self, **kwargs):
         """
         Get the cast and crew information for a specific movie id.
-        
+
         Args:
             append_to_response: (optional) Comma separated, any movie method.
 
@@ -100,12 +101,12 @@ class Movies(TMDB):
     def images(self, **kwargs):
         """
         Get the images (posters and backdrops) for a specific movie id.
-        
+
         Args:
             language: (optional) ISO 639-1 code.
             append_to_response: (optional) Comma separated, any movie method.
-            include_image_language: (optional) Comma separated, a valid 
-                                    ISO 69-1. 
+            include_image_language: (optional) Comma separated, a valid
+                                    ISO 69-1.
 
         Returns:
             A dict respresentation of the JSON returned from the API.
@@ -116,27 +117,40 @@ class Movies(TMDB):
         self._set_attrs_to_values(response)
         return response
 
-    def keywords(self, **kwargs):
+    def keywords(self):
         """
         Get the plot keywords for a specific movie id.
-        
-        Args:
-            append_to_response: (optional) Comma separated, any movie method.
 
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
         path = self._get_id_path('keywords')
 
-        response = self._GET(path, kwargs)
+        response = self._GET(path)
         self._set_attrs_to_values(response)
         return response
 
+    def release_dates(self, **kwargs):
+         """
+         Get the release dates and certification for a specific movie id.
+
+         Args:
+             append_to_response: (optional) Comma separated, any movie method.
+
+         Returns:
+             A dict respresentation of the JSON returned from the API.
+         """
+         path = self._get_id_path('release_dates')
+
+         response = self._GET(path, kwargs)
+         self._set_attrs_to_values(response)
+         return response
+
     def releases(self, **kwargs):
         """
-        Get the release date and certification information by country for a 
+        Get the release date and certification information by country for a
         specific movie id.
-        
+
         Args:
             append_to_response: (optional) Comma separated, any movie method.
 
@@ -151,9 +165,9 @@ class Movies(TMDB):
 
     def videos(self, **kwargs):
         """
-        Get the videos (trailers, teasers, clips, etc...) for a 
+        Get the videos (trailers, teasers, clips, etc...) for a
         specific movie id.
-        
+
         Args:
             append_to_response: (optional) Comma separated, any movie method.
 
@@ -169,7 +183,7 @@ class Movies(TMDB):
     def translations(self, **kwargs):
         """
         Get the translations for a specific movie id.
-        
+
         Args:
             append_to_response: (optional) Comma separated, any movie method.
 
@@ -185,7 +199,7 @@ class Movies(TMDB):
     def similar_movies(self, **kwargs):
         """
         Get the similar movies for a specific movie id.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -203,7 +217,7 @@ class Movies(TMDB):
     def reviews(self, **kwargs):
         """
         Get the reviews for a particular movie id.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -221,7 +235,7 @@ class Movies(TMDB):
     def lists(self, **kwargs):
         """
         Get the lists that the movie belongs to.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -240,11 +254,11 @@ class Movies(TMDB):
         """
         Get the changes for a specific movie id.
 
-        Changes are grouped by key, and ordered by date in descending order. 
-        By default, only the last 24 hours of changes are returned. The 
-        maximum number of days that can be returned in a single request is 14. 
+        Changes are grouped by key, and ordered by date in descending order.
+        By default, only the last 24 hours of changes are returned. The
+        maximum number of days that can be returned in a single request is 14.
         The language is present on fields that are translatable.
-        
+
         Args:
             start_date: (optional) Expected format is 'YYYY-MM-DD'.
             end_date: (optional) Expected format is 'YYYY-MM-DD'.
@@ -261,7 +275,7 @@ class Movies(TMDB):
     def latest(self, **kwargs):
         """
         Get the latest movie id.
-        
+
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
@@ -273,9 +287,9 @@ class Movies(TMDB):
 
     def upcoming(self, **kwargs):
         """
-        Get the list of upcoming movies. This list refreshes every day. 
+        Get the list of upcoming movies. This list refreshes every day.
         The maximum number of items this list will include is 100.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -291,9 +305,9 @@ class Movies(TMDB):
 
     def now_playing(self, **kwargs):
         """
-        Get the list of movies playing in theatres. This list refreshes 
+        Get the list of movies playing in theatres. This list refreshes
         every day. The maximum number of items this list will include is 100.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -309,9 +323,9 @@ class Movies(TMDB):
 
     def popular(self, **kwargs):
         """
-        Get the list of popular movies on The Movie Database. This list 
+        Get the list of popular movies on The Movie Database. This list
         refreshes every day.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -327,10 +341,10 @@ class Movies(TMDB):
 
     def top_rated(self, **kwargs):
         """
-        Get the list of top rated movies. By default, this list will only 
-        include movies that have 10 or more votes. This list refreshes every 
+        Get the list of top rated movies. By default, this list will only
+        include movies that have 10 or more votes. This list refreshes every
         day.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -346,10 +360,10 @@ class Movies(TMDB):
 
     def account_states(self, **kwargs):
         """
-        This method lets users get the status of whether or not the movie has 
-        been rated or added to their favourite or watch lists. A valid session 
+        This method lets users get the status of whether or not the movie has
+        been rated or added to their favourite or watch lists. A valid session
         id is required.
-        
+
         Args:
             session_id: see Authentication.
 
@@ -364,7 +378,7 @@ class Movies(TMDB):
 
     def rating(self, **kwargs):
         """
-        This method lets users rate a movie. A valid session id or guest 
+        This method lets users rate a movie. A valid session id or guest
         session id is required.
 
         Args:
@@ -388,9 +402,9 @@ class Movies(TMDB):
 
 class Collections(TMDB):
     """
-    Collections functionality. 
+    Collections functionality.
 
-    See: http://docs.themoviedb.apiary.io/#collections
+    See: https://developers.themoviedb.org/3/collections
     """
     BASE_PATH = 'collection'
     URLS = {
@@ -404,13 +418,13 @@ class Collections(TMDB):
 
     def info(self, **kwargs):
         """
-        Get the basic collection information for a specific collection id. 
-        You can get the ID needed for this method by making a /movie/{id} 
+        Get the basic collection information for a specific collection id.
+        You can get the ID needed for this method by making a /movie/{id}
         request and paying attention to the belongs_to_collection hash.
 
-        Movie parts are not sorted in any particular order. If you would like 
+        Movie parts are not sorted in any particular order. If you would like
         to sort them yourself you can use the provided release_date.
-        
+
         Args:
             language: (optional) ISO 639-1 code.
             append_to_response: (optional) Comma separated, any movie method.
@@ -427,12 +441,12 @@ class Collections(TMDB):
     def images(self, **kwargs):
         """
         Get all of the images for a particular collection by collection id.
-        
+
         Args:
             language: (optional) ISO 639-1 code.
             append_to_response: (optional) Comma separated, any movie method.
-            include_image_language: (optional) Comma separated, a valid 
-            ISO 69-1. 
+            include_image_language: (optional) Comma separated, a valid
+            ISO 69-1.
 
         Returns:
             A dict respresentation of the JSON returned from the API.
@@ -445,9 +459,9 @@ class Collections(TMDB):
 
 class Companies(TMDB):
     """
-    Companies functionality. 
+    Companies functionality.
 
-    See: http://docs.themoviedb.apiary.io/#companies
+    See: https://developers.themoviedb.org/3/companies
     """
     BASE_PATH = 'company'
     URLS = {
@@ -461,9 +475,9 @@ class Companies(TMDB):
 
     def info(self, **kwargs):
         """
-        This method is used to retrieve all of the basic information about a 
+        This method is used to retrieve all of the basic information about a
         company.
-        
+
         Args:
             append_to_response: (optional) Comma separated, any movie method.
 
@@ -475,11 +489,11 @@ class Companies(TMDB):
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
         return response
-        
+
     def movies(self, **kwargs):
         """
         Get the list of movies associated with a particular company.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -496,9 +510,9 @@ class Companies(TMDB):
 
 class Keywords(TMDB):
     """
-    Keywords functionality. 
+    Keywords functionality.
 
-    See: http://docs.themoviedb.apiary.io/#keywords
+    See: https://developers.themoviedb.org/3/keywords
     """
     BASE_PATH = 'keyword'
     URLS = {
@@ -513,7 +527,7 @@ class Keywords(TMDB):
     def info(self, **kwargs):
         """
         Get the basic information for a specific keyword id.
-        
+
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
@@ -526,7 +540,7 @@ class Keywords(TMDB):
     def movies(self, **kwargs):
         """
         Get the list of movies for a particular keyword by id.
-        
+
         Args:
             page: (optional) Minimum value of 1.  Expected value is an integer.
             language: (optional) ISO 639-1 code.
@@ -542,9 +556,9 @@ class Keywords(TMDB):
 
 class Reviews(TMDB):
     """
-    Reviews functionality. 
+    Reviews functionality.
 
-    See: http://docs.themoviedb.apiary.io/#reviews
+    See: https://developers.themoviedb.org/3/reviews
     """
     BASE_PATH = 'review'
     URLS = {
@@ -558,7 +572,7 @@ class Reviews(TMDB):
     def info(self, **kwargs):
         """
         Get the full details of a review by ID.
-        
+
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
diff --git a/tmdbsimple/people.py b/tmdbsimple/people.py
index 6d67863..e4b249f 100644
--- a/tmdbsimple/people.py
+++ b/tmdbsimple/people.py
@@ -18,7 +18,7 @@ class People(TMDB):
     """
     People functionality.
 
-    See: http://docs.themoviedb.apiary.io/#people
+    See: https://developers.themoviedb.org/3/people
     """
     BASE_PATH = 'person'
     URLS = {
@@ -190,7 +190,7 @@ class Credits(TMDB):
     """
     Credits functionality.
 
-    See: http://docs.themoviedb.apiary.io/#credits
+    See: https://developers.themoviedb.org/3/credits
     """
     BASE_PATH = 'credit'
     URLS = {
@@ -230,7 +230,7 @@ class Jobs(TMDB):
     """
     Jobs functionality.
 
-    See: http://docs.themoviedb.apiary.io/#jobs
+    See: https://developers.themoviedb.org/3/jobs
     """
     BASE_PATH = 'job'
     URLS = {
diff --git a/tmdbsimple/search.py b/tmdbsimple/search.py
index e84c9ba..2a1c252 100644
--- a/tmdbsimple/search.py
+++ b/tmdbsimple/search.py
@@ -17,7 +17,7 @@ class Search(TMDB):
     """
     Search functionality
 
-    See: http://docs.themoviedb.apiary.io/#search
+    See: https://developers.themoviedb.org/3/search
     """
     BASE_PATH = 'search'
     URLS = {
diff --git a/tmdbsimple/tv.py b/tmdbsimple/tv.py
index 8e75301..c4d6101 100644
--- a/tmdbsimple/tv.py
+++ b/tmdbsimple/tv.py
@@ -3,7 +3,7 @@
 """
 tmdbsimple.tv
 ~~~~~~~~~~~~~
-This module implements the TV, TV Seasons, TV Episodes, and Networks 
+This module implements the TV, TV Seasons, TV Episodes, and Networks
 functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
@@ -18,12 +18,13 @@ class TV(TMDB):
     """
     TV functionality.
 
-    See: http://docs.themoviedb.apiary.io/#tv
+    See: https://developers.themoviedb.org/3/tv
     """
     BASE_PATH = 'tv'
     URLS = {
         'info': '/{id}',
         'alternative_titles': '/{id}/alternative_titles',
+        'content_ratings': '/{id}/content_ratings',
         'credits': '/{id}/credits',
         'external_ids': '/{id}/external_ids',
         'images': '/{id}/images',
@@ -49,7 +50,7 @@ class TV(TMDB):
 
         Args:
             language: (optional) ISO 639 code.
-            append_to_response: (optional) Comma separated, any TV series 
+            append_to_response: (optional) Comma separated, any TV series
                                 method.
 
         Returns:
@@ -65,7 +66,7 @@ class TV(TMDB):
     def alternative_titles(self, **kwargs):
         """
         Get the alternative titles for a specific tv id.
-        
+
         Args:
             language: (optional) ISO 3166-1 code.
             append_to_response: (optional) Comma separated, any tv method.
@@ -79,14 +80,32 @@ class TV(TMDB):
         return response
 
 
+    def content_ratings(self, **kwargs):
+        """
+        Get the content ratings for a TV Series.
+
+        Args:
+            language: (optional) ISO 639 code.
+            append_to_response: (optional) Comma separated, any collection
+                                method.
+
+        Returns:
+            A dict respresentation of the JSON returned from the API.
+        """
+        path = self._get_id_path('content_ratings')
+
+        response = self._GET(path, kwargs)
+        self._set_attrs_to_values(response)
+        return response
+
     def credits(self, **kwargs):
         """
-        Get the cast & crew information about a TV series. Just like the 
+        Get the cast & crew information about a TV series. Just like the
         website, we pull this information from the last season of the series.
 
         Args:
             language: (optional) ISO 639 code.
-            append_to_response: (optional) Comma separated, any collection 
+            append_to_response: (optional) Comma separated, any collection
                                 method.
 
         Returns:
@@ -120,7 +139,7 @@ class TV(TMDB):
 
         Args:
             language: (optional) ISO 639 code.
-            include_image_language: (optional) Comma separated, a valid 
+            include_image_language: (optional) Comma separated, a valid
                                     ISO 69-1.
 
         Returns:
@@ -192,7 +211,7 @@ class TV(TMDB):
 
     def translations(self, **kwargs):
         """
-        Get the list of translations that exist for a TV series. These 
+        Get the list of translations that exist for a TV series. These
         translations cascade down to the episode level.
 
         Returns:
@@ -278,8 +297,8 @@ class TV(TMDB):
 
     def top_rated(self, **kwargs):
         """
-        Get the list of top rated TV shows. By default, this list will only 
-        include TV shows that have 2 or more votes. This list refreshes every 
+        Get the list of top rated TV shows. By default, this list will only
+        include TV shows that have 2 or more votes. This list refreshes every
         day.
 
         Args:
@@ -317,9 +336,9 @@ class TV_Seasons(TMDB):
     """
     TV Seasons functionality.
 
-    See: http://docs.themoviedb.apiary.io/#tvseasons
+    See: https://developers.themoviedb.org/3/tv-seasons
     """
-    BASE_PATH = 'tv/{id}/season/{season_number}'
+    BASE_PATH = 'tv/{series_id}/season/{season_number}'
     URLS = {
         'info': '',
         'credits': '/credits',
@@ -328,9 +347,9 @@ class TV_Seasons(TMDB):
         'videos': '/videos',
     }
 
-    def __init__(self, id, season_number):
+    def __init__(self, series_id, season_number):
         super(TV_Seasons, self).__init__()
-        self.id = id
+        self.series_id = series_id
         self.season_number = season_number
 
     def info(self, **kwargs):
@@ -339,13 +358,13 @@ class TV_Seasons(TMDB):
 
         Args:
             language: (optional) ISO 639 code.
-            append_to_response: (optional) Comma separated, any TV series 
+            append_to_response: (optional) Comma separated, any TV series
                                 method.
 
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
-        path = self._get_id_season_number_path('info')
+        path = self._get_series_id_season_number_path('info')
 
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
@@ -358,7 +377,7 @@ class TV_Seasons(TMDB):
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
-        path = self._get_id_season_number_path('credits')
+        path = self._get_series_id_season_number_path('credits')
 
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
@@ -366,7 +385,7 @@ class TV_Seasons(TMDB):
 
     def external_ids(self, **kwargs):
         """
-        Get the external ids that we have stored for a TV season by season 
+        Get the external ids that we have stored for a TV season by season
         number.
 
         Args:
@@ -375,7 +394,7 @@ class TV_Seasons(TMDB):
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
-        path = self._get_id_season_number_path('external_ids')
+        path = self._get_series_id_season_number_path('external_ids')
 
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
@@ -383,18 +402,18 @@ class TV_Seasons(TMDB):
 
     def images(self, **kwargs):
         """
-        Get the images (posters) that we have stored for a TV season by season 
+        Get the images (posters) that we have stored for a TV season by season
         number.
 
         Args:
             language: (optional) ISO 639 code.
-            include_image_language: (optional) Comma separated, a valid 
+            include_image_language: (optional) Comma separated, a valid
                                     ISO 69-1.
 
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
-        path = self._get_id_season_number_path('images')
+        path = self._get_series_id_season_number_path('images')
 
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
@@ -411,7 +430,7 @@ class TV_Seasons(TMDB):
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
-        path = self._get_id_season_number_path('videos')
+        path = self._get_series_id_season_number_path('videos')
 
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
@@ -422,7 +441,7 @@ class TV_Episodes(TMDB):
     """
     TV Episodes functionality.
 
-    See: http://docs.themoviedb.apiary.io/#tvepisodes
+    See: https://developers.themoviedb.org/3/tv-episodes
     """
     BASE_PATH = 'tv/{series_id}/season/{season_number}/episode/{episode_number}'
     URLS = {
@@ -442,12 +461,12 @@ class TV_Episodes(TMDB):
 
     def info(self, **kwargs):
         """
-        Get the primary information about a TV episode by combination of a 
+        Get the primary information about a TV episode by combination of a
         season and episode number.
 
         Args:
             language: (optional) ISO 639 code.
-            append_to_response: (optional) Comma separated, any TV series 
+            append_to_response: (optional) Comma separated, any TV series
                                 method.
... 42 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-tmdbsimple.git



More information about the Python-modules-commits mailing list