Skip to content

Collections

Bases: TMDB

Collections functionality.

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

Source code in src/tmdb_client_py/movies.py
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
class Collections(TMDB):
    """
    Collections functionality.

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

    BASE_PATH = "collection"
    URLS = {
        "info": "/{id}",
        "images": "/{id}/images",
        "translations": "/{id}/translations",
    }

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

    def info(self, **kwargs):
        """
        Get collection details by id.

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

        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 images(self, **kwargs):
        """
        Get the images for a collection by id.

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

        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 the translations for a collection by id.

        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

images(**kwargs)

Get the images for a collection by id.

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/movies.py
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
def images(self, **kwargs):
    """
    Get the images for a collection by id.

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

    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 collection details by id.

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/movies.py
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
def info(self, **kwargs):
    """
    Get collection details by id.

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

    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

translations(**kwargs)

Get a list of the translations for a collection by id.

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/movies.py
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
def translations(self, **kwargs):
    """
    Get a list of the translations for a collection by id.

    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