Skip to content

Rotten Tomatoes

Usage

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

await phylm.load_source("rt")

Alternatively you can instantiate the Rotten Tomatoes source class directly through:

from phylm.sources import Rt

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

Reference

Class to abstract a Rotten Tomatoes result.

title: Optional[str] property

Return the title.

Returns:

Type Description
Optional[str]

the title of the movie

tomato_score: Optional[str] property

Return the Tomatometer Score.

Returns:

Type Description
Optional[str]

the tomatometer score

year: Optional[str] property

Return the year.

Returns:

Type Description
Optional[str]

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