Skip to content

Metacritic

Usage

To access Metacritic data points, first ensure you have loaded the Metacritic source through:

await phylm.load_source("mtc")

Alternatively you can instantiate the Metacritic source class directly through:

from phylm.sources import Mtc

mtc = Mtc(raw_title="The Matrix", raw_year=1999)  # raw_year is optional
await mtc.load_source()

Reference

Class to abstract a Metacritic movie search result.

rating: Optional[str] property

Return the rating.

Returns:

Type Description
Optional[str]

the mtc rating

title: Optional[str] property

Return the title.

Returns:

Type Description
Optional[str]

the title of the movie

year: Optional[int] property

Return the year.

Returns:

Type Description
Optional[int]

the year of the movie

__init__(raw_title: str, raw_year: Optional[int] = None) -> None

Initialize the object.

Parameters:

Name Type Description Default
raw_title str

the given title of the movie

required
raw_year Optional[int]

an optional year for improved matching

None

load_source(session: Optional[ClientSession] = None) -> None async

Asynchronously load the data from the source.

Parameters:

Name Type Description Default
session Optional[ClientSession]

an optional instance of aiohttp.ClientSession in which to run the request

None

Last update: 2023-10-18