Exemplo n.º 1
0
 def test_dict_obj_pop(self):
     dict_obj = AsObj(**self.entries)
     pop = dict_obj.pop('title')
     self.assertNotIn('title', dict_obj)
     self.assertEqual(pop, 'images')
     pop = dict_obj.pop('random', 'noexist')
     self.assertEqual(pop, 'noexist')
Exemplo n.º 2
0
 def combined_credits(self, person_id):
     """
     Get the movie and TV credits together in a single response.
     :return:
     """
     return AsObj(
         **self._call(self._urls["combined_credits"] % str(person_id), ""))
Exemplo n.º 3
0
 def details(self, company_id):
     """
     Get a companies details by id.
     :param company_id: int
     :return:
     """
     return AsObj(**self._call(self._urls['details'] % str(company_id), ''))
Exemplo n.º 4
0
 def details(self, keyword_id):
     """
     Get a keywords details by id.
     :param keyword_id: int
     :return:
     """
     return AsObj(**self._call(self._urls["details"] % str(keyword_id), ""))
Exemplo n.º 5
0
 def images(self, movie_id):
     """
     Get the images that belong to a movie.
     :param movie_id:
     :return:
     """
     return AsObj(**self._call(self._urls['images'] % movie_id, ''))
Exemplo n.º 6
0
 def movie_credits(self, person_id):
     """
     Get the movie credits for a person.
     :return:
     """
     return AsObj(**self._call(self._urls["movie_credits"] %
                               str(person_id), ""))
Exemplo n.º 7
0
 def details(self, person_id):
     """
     Get the primary person details by id.
     :param person_id: int
     :return:
     """
     return AsObj(**self._call(self._urls['details'] % str(person_id), ''))
Exemplo n.º 8
0
 def keywords(self, movie_id):
     """
     Get the keywords associated to a movie.
     :param movie_id:
     :return:
     """
     return AsObj(**self._call(self._urls['keywords'] % movie_id, ''))
Exemplo n.º 9
0
 def release_dates(self, movie_id):
     """
     Get the release date along with the certification for a movie.
     :param movie_id:
     :return:
     """
     return AsObj(**self._call(self._urls['release_dates'] % movie_id, ''))
Exemplo n.º 10
0
 def details(self, collection_id):
     """
     Get collection details by id.
     :param collection_id:
     :return:
     """
     return AsObj(**self._call(self._urls["details"] % str(collection_id), ""))
Exemplo n.º 11
0
 def tv_credits(self, person_id):
     """
     Get the TV show credits for a person.
     :return:
     """
     return AsObj(**self._call(self._urls["tv_credits"] %
                               str(person_id), ""))
Exemplo n.º 12
0
 def details(self, network_id):
     """
     Get a networks details by id.
     :param network_id: int
     :return:
     """
     return AsObj(**self._call(self._urls["details"] % str(network_id), ""))
Exemplo n.º 13
0
 def external_ids(self, id):
     """
     Get the external ids for a TV show.
     :param id:
     :return:
     """
     return AsObj(**self._call(self._urls['external_ids'] % id, ''))
Exemplo n.º 14
0
 def credits(self, movie_id):
     """
     Get the cast and crew for a movie.
     :param movie_id:
     :return:
     """
     return AsObj(**self._call(self._urls["credits"] % movie_id, ""))
Exemplo n.º 15
0
 def images(self, collection_id):
     """
     Get the images for a collection by id.
     :param collection_id:
     :return:
     """
     return AsObj(**self._call(self._urls["images"] % str(collection_id), ""))
Exemplo n.º 16
0
 def images(self, person_id):
     """
     Get the images for a person.
     :param person_id: int
     :return:
     """
     return AsObj(**self._call(self._urls["images"] % str(person_id), ""))
Exemplo n.º 17
0
 def watch_providers(self, movie_id):
     """
     Get the Watch Providers for a movie.
     :param movie_id:
     :return:
     """
     return AsObj(**self._call(self._urls['watch_providers'] %
                               movie_id, ''))
Exemplo n.º 18
0
 def details(self, show_id, append_to_response='videos,trailers,images,credits,translations'):
     """
     Get the primary TV show details by id.
     :param show_id:
     :param append_to_response:
     :return:
     """
     return AsObj(**self._call(self._urls['details'] % str(show_id), 'append_to_response=' + append_to_response))
Exemplo n.º 19
0
 def alternative_titles(self, movie_id, country=""):
     """
     Get all of the alternative titles for a movie.
     :param movie_id:
     :param country:
     :return:
     """
     return AsObj(**self._call(self._urls["alternative_titles"] %
                               movie_id, "country=" + country))
Exemplo n.º 20
0
 def details(self,
             tv_id,
             season_num,
             episode_num,
             append_to_response="trailers,images,casts,translations"):
     return AsObj(**self._call(
         self._urls['details'] %
         (str(tv_id), str(season_num),
          str(episode_num)), "append_to_response=%s" % append_to_response))
Exemplo n.º 21
0
 def test_dict_obj__setitem__(self):
     dict_obj = AsObj()
     dict_obj['title'] = 'images'
     dict_obj['results'] = [{'path': 'img/'}]
     dict_obj['formats'] = ['.jpg']
     dict_obj['langs'] = {'ES': 'es-ES'}
     self.assertEqual(dict_obj['title'], 'images')
     self.assertEqual(dict_obj['results'][0]['path'], 'img/')
     self.assertEqual(dict_obj['formats'][0], '.jpg')
     self.assertEqual(dict_obj['langs']['ES'], 'es-ES')
 def details(self, person_id, append_to_response='videos,images'):
     """
     Get the primary person details by id.
     :param append_to_response: str
     :param person_id: int
     :return:
     """
     return AsObj(**self._call(self._urls['details'] %
                               str(person_id), 'append_to_response=' +
                               append_to_response))
Exemplo n.º 23
0
 def details(self, person_id, append_to_response="videos,images"):
     """
     Get the primary person details by id.
     :param append_to_response: str
     :param person_id: int
     :return:
     """
     return AsObj(**self._call(
         self._urls["details"] % str(person_id),
         "append_to_response=" + append_to_response,
     ))
Exemplo n.º 24
0
 def changes(
     self,
     season_id,
     append_to_response="append_to_response=trailers,images,casts,translations"
 ):
     """
     Get the changes for a TV season. By default only the last 24 hours are returned.
     :param season_id:
     :return:
     """
     return AsObj(**self._call(self._urls['changes'] %
                               str(season_id), append_to_response))
Exemplo n.º 25
0
 def details(
     self,
     movie_id,
     append_to_response="append_to_response=trailers,images,casts,translations,keywords"
 ):
     """
     Get the primary information about a movie.
     :param movie_id:
     :param append_to_response:
     :return:
     """
     return AsObj(**self._call(self._urls['details'] %
                               movie_id, append_to_response))
Exemplo n.º 26
0
 def changes(
         self,
         season_id,
         append_to_response="videos,trailers,images,casts,translations"):
     """
     Get the changes for a TV season. By default only the last 24 hours are returned.
     :param append_to_response: str
     :param season_id: int
     :return:
     """
     return AsObj(**self._call(
         self._urls["changes"] % str(season_id),
         "append_to_response=" + append_to_response,
     ))
Exemplo n.º 27
0
 def images(self, movie_id, include_image_language=""):
     """
     Get the images that belong to a movie.
     Querying images with a language parameter will filter the results. 
     If you want to include a fallback language (especially useful for backdrops) you can use the include_image_language parameter. 
     This should be a comma seperated value like so: include_image_language=en,null.
     :param movie_id:
     :param include_image_language:
     :return:
     """
     return AsObj(
         **self._call(self._urls['images'] %
                      movie_id, "include_image_language=" +
                      include_image_language))
Exemplo n.º 28
0
 def details(
     self,
     movie_id,
     append_to_response="videos,trailers,images,casts,translations,keywords,release_dates",
 ):
     """
     Get the primary information about a movie.
     :param movie_id:
     :param append_to_response:
     :return:
     """
     return AsObj(**self._call(
         self._urls["details"] % movie_id,
         "append_to_response=" + append_to_response,
     ))
Exemplo n.º 29
0
 def details(
         self,
         tv_id,
         season_num,
         append_to_response='videos,trailers,images,credits,translations'):
     """
     Get the TV season details by id.
     :param tv_id:
     :param season_num:
     :param append_to_response:
     :return:
     """
     return AsObj(
         **self._call(self._urls['details'] %
                      (str(tv_id), str(season_num)), 'append_to_response=' +
                      append_to_response))
Exemplo n.º 30
0
    def test_dict_obj_fromkeys(self):
        dict_obj = AsObj().fromkeys({'a', 'b'})
        self.assertEqual(len(dict_obj), 2)
        self.assertTrue(hasattr(dict_obj, 'a'))
        self.assertTrue(hasattr(dict_obj, 'b'))
        for value in dict_obj.values():
            self.assertIsNone(value)

        dict_obj = AsObj().fromkeys({'a', 'b'}, 1)
        self.assertEqual(len(dict_obj), 2)
        self.assertTrue(hasattr(dict_obj, 'a'))
        self.assertTrue(hasattr(dict_obj, 'b'))
        for value in dict_obj.values():
            self.assertEqual(value, 1)