Skip to content

People

Bases: TMDB

People functionality.

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

Source code in src/tmdb_client_py/people.py
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
class People(TMDB):
    """
    People functionality.

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

    BASE_PATH = "person"
    URLS = {
        "info": "/{id}",
        "changes": "/{id}/changes",
        "movie_credits": "/{id}/movie_credits",
        "tv_credits": "/{id}/tv_credits",
        "combined_credits": "/{id}/combined_credits",
        "external_ids": "/{id}/external_ids",
        "images": "/{id}/images",
        "tagged_images": "/{id}/tagged_images",
        "translations": "/{id}/translations",
        "latest": "/latest",
        "popular": "/popular",
    }

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

    def info(self, **kwargs):
        """
        Get the primary person details by id.

        Supports append_to_response. Read more about this at
        https://developers.themoviedb.org/3/getting-started/append-to-response.

        Args:
            language: (optional) ISO 639-1 code.
            append_to_response: (optional) Append requests within the same
                namespace to the response.

        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 changes(self, **kwargs):
        """
        Get the changes for a person. By default only the last 24 hours are returned.

        You can query up to 14 days in a single query by using the start_date
        and end_date query parameters.

        Args:
            start_date: (optional) Filter the results with a start date.
                Expected format is 'YYYY-MM-DD'.
            end_date: (optional) Filter the results with a end date.
                Expected format is 'YYYY-MM-DD'.
            page: (optional) Minimum 1, maximum 1000, default 1.

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

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

    def movie_credits(self, **kwargs):
        """
        Get the movie credits for a person.

        Args:
            language: (optional) ISO 639-1 code.

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

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

    def tv_credits(self, **kwargs):
        """
        Get the TV show credits for a person.

        You can query for some extra details about the credit with the credit
        method.

        Args:
            language: (optional) ISO 639-1 code.

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

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

    def combined_credits(self, **kwargs):
        """
        Get the movie and TV credits together in a single response.

        Args:
            language: (optional) ISO 639-1 code.

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

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

    def external_ids(self, **kwargs):
        """
        Get the external ids for a person. We currently support the following external sources.

        External Sources
            - IMDB ID
            - Facebook
            - Freebase MID
            - Freebase ID
            - Instagram
            - TVRage ID
            - Twitter

        Args:
            language: (optional) ISO 639-1 code.

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

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

    def images(self, **kwargs):
        """
        Get the images for a person.

        Args:
            None

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

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

    def translations(self, **kwargs):
        """
        Get a list of translations that have been created for a person.

        Args:
            language: (optional) ISO 639-1 code.

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

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

    def latest(self, **kwargs):
        """
        Get the most newly created person. This is a live response and will
        continuously change.

        Args:
            language: (optional) ISO 639-1 code.

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

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

    def popular(self, **kwargs):
        """
        Get the list of popular people on TMDb. This list updates daily.

        Args:
            language: (optional) ISO 639-1 code.
            page: (optional) Minimum 1, maximum 1000, default 1.

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

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

changes(**kwargs)

Get the changes for a person. By default only the last 24 hours are returned.

You can query up to 14 days in a single query by using the start_date and end_date query parameters.

Parameters:

Name Type Description Default
start_date

(optional) Filter the results with a start date. Expected format is 'YYYY-MM-DD'.

required
end_date

(optional) Filter the results with a end date. Expected format is 'YYYY-MM-DD'.

required
page

(optional) Minimum 1, maximum 1000, default 1.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
def changes(self, **kwargs):
    """
    Get the changes for a person. By default only the last 24 hours are returned.

    You can query up to 14 days in a single query by using the start_date
    and end_date query parameters.

    Args:
        start_date: (optional) Filter the results with a start date.
            Expected format is 'YYYY-MM-DD'.
        end_date: (optional) Filter the results with a end date.
            Expected format is 'YYYY-MM-DD'.
        page: (optional) Minimum 1, maximum 1000, default 1.

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

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

combined_credits(**kwargs)

Get the movie and TV credits together in a single response.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
def combined_credits(self, **kwargs):
    """
    Get the movie and TV credits together in a single response.

    Args:
        language: (optional) ISO 639-1 code.

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

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

external_ids(**kwargs)

Get the external ids for a person. We currently support the following external sources.

External Sources - IMDB ID - Facebook - Freebase MID - Freebase ID - Instagram - TVRage ID - Twitter

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
def external_ids(self, **kwargs):
    """
    Get the external ids for a person. We currently support the following external sources.

    External Sources
        - IMDB ID
        - Facebook
        - Freebase MID
        - Freebase ID
        - Instagram
        - TVRage ID
        - Twitter

    Args:
        language: (optional) ISO 639-1 code.

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

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

images(**kwargs)

Get the images for a person.

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
def images(self, **kwargs):
    """
    Get the images for a person.

    Args:
        None

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

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

info(**kwargs)

Get the primary person details by id.

Supports append_to_response. Read more about this at https://developers.themoviedb.org/3/getting-started/append-to-response.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required
append_to_response

(optional) Append requests within the same namespace to the response.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def info(self, **kwargs):
    """
    Get the primary person details by id.

    Supports append_to_response. Read more about this at
    https://developers.themoviedb.org/3/getting-started/append-to-response.

    Args:
        language: (optional) ISO 639-1 code.
        append_to_response: (optional) Append requests within the same
            namespace to the response.

    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

latest(**kwargs)

Get the most newly created person. This is a live response and will continuously change.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
def latest(self, **kwargs):
    """
    Get the most newly created person. This is a live response and will
    continuously change.

    Args:
        language: (optional) ISO 639-1 code.

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

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

movie_credits(**kwargs)

Get the movie credits for a person.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def movie_credits(self, **kwargs):
    """
    Get the movie credits for a person.

    Args:
        language: (optional) ISO 639-1 code.

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

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

popular(**kwargs)

Get the list of popular people on TMDb. This list updates daily.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required
page

(optional) Minimum 1, maximum 1000, default 1.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
def popular(self, **kwargs):
    """
    Get the list of popular people on TMDb. This list updates daily.

    Args:
        language: (optional) ISO 639-1 code.
        page: (optional) Minimum 1, maximum 1000, default 1.

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

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

translations(**kwargs)

Get a list of translations that have been created for a person.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
def translations(self, **kwargs):
    """
    Get a list of translations that have been created for a person.

    Args:
        language: (optional) ISO 639-1 code.

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

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

tv_credits(**kwargs)

Get the TV show credits for a person.

You can query for some extra details about the credit with the credit method.

Parameters:

Name Type Description Default
language

(optional) ISO 639-1 code.

required

Returns:

Type Description

A dict representation of the JSON returned from the API.

Source code in src/tmdb_client_py/people.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
def tv_credits(self, **kwargs):
    """
    Get the TV show credits for a person.

    You can query for some extra details about the credit with the credit
    method.

    Args:
        language: (optional) ISO 639-1 code.

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

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