Skip to content

Keywords

Bases: TMDB

Keywords functionality.

See: https://developers.themoviedb.org/3/keywords

Source code in src/tmdb_client_py/movies.py
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
class Keywords(TMDB):
    """
    Keywords functionality.

    See: https://developers.themoviedb.org/3/keywords
    """

    BASE_PATH = "keyword"
    URLS = {
        "info": "/{id}",
        "movies": "/{id}/movies",
    }

    def __init__(self, id):
        super().__init__()
        self.id = id

    def info(self, **kwargs):
        """
        Get the details of a keyword.

        Args:
           None

        Returns:
            A dict representation of the JSON returned from the API.
        """
        path = self._get_id_path("info")

        response = self._GET(path, kwargs)
        self._set_attrs_to_values(response)
        return response

    def movies(self, **kwargs):
        """
        Get the movies that belong to a keyword.

        We highly recommend using movie discover instead of this method as it
        is much more flexible.

        Args:
            language: (optional) ISO 639-1 code.
            include_adult: Choose whether to include adult (pornography)
                content in the results.

        Returns:
            A dict representation of the JSON returned from the API.
        """
        path = self._get_id_path("movies")

        response = self._GET(path, kwargs)
        self._set_attrs_to_values(response)
        return response

info(**kwargs)

Get the details of a keyword.

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/movies.py
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
def info(self, **kwargs):
    """
    Get the details of a keyword.

    Args:
       None

    Returns:
        A dict representation of the JSON returned from the API.
    """
    path = self._get_id_path("info")

    response = self._GET(path, kwargs)
    self._set_attrs_to_values(response)
    return response

movies(**kwargs)

Get the movies that belong to a keyword.

We highly recommend using movie discover instead of this method as it is much more flexible.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required
include_adult

Choose whether to include adult (pornography) content in the results.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/movies.py
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
def movies(self, **kwargs):
    """
    Get the movies that belong to a keyword.

    We highly recommend using movie discover instead of this method as it
    is much more flexible.

    Args:
        language: (optional) ISO 639-1 code.
        include_adult: Choose whether to include adult (pornography)
            content in the results.

    Returns:
        A dict representation of the JSON returned from the API.
    """
    path = self._get_id_path("movies")

    response = self._GET(path, kwargs)
    self._set_attrs_to_values(response)
    return response