Welcome to pymojo’s documentation!
An unoffical scraper for Box Office Mojo.
pymojo module
Main module.
pymojo.pymojo.get_domestic_box_office_for_season(season: str, year: int | str)
Parses the Box Office Mojo single page with a listing of films for a season.
-
Parameters
-
season – Season key, (ex. “summer”)
-
year – Year
-
-
Returns
list of dict with the following keys {title str, release_id str, gross int, total_gross int, released : datetime}
pymojo.pymojo.get_domestic_gross(mojo_id: str)
Return only the domestic gross earnings as an integer
-
Parameters
mojo_id – Mojo Release ID (ex. “rl1107461633”)
-
Returns
int showing dollar value of domestic gross earnings.
pymojo.pymojo.get_gross(mojo_id: str)
Get gross earnings for a movie by release ID.
-
Parameters
mojo_id – Mojo Release ID (ex. “rl1107461633”)
-
Returns
dict of {‘domestic’: int, ‘international’: int, ‘worldwide’:int}
pymojo.pymojo.get_imdb_id_from_mojo_id(mojo_id: str)
Get the IMDB ID from a Mojo Release ID.
-
Parameters
mojo_id – Mojo Release ID (ex. “rl1107461633”)
-
Returns
IMDB ID (ex. tt7349950), None if none found
pymojo.pymojo.get_mojo_id_from_imdb_id(imdb_id)
Get Mojo Release ID from an IMDB ID.
-
Parameters
imdb_id – IMDB ID (ex. tt7349950)
-
Returns
Mojo Release ID (ex. “rl1107461633”), None if none found
pymojo.pymojo.get_new_mojo_id(legacy_id: str)
Convert from the “mojo_id” used before redesign of Box Office Mojo (~2020) From http://www.boxofficemojo.com/movies/?id={legacy_id}.htm to the current format: https://www.boxofficemojo.com/release/{current_id}/
-
Parameters
legacy_id – Legacy Mojo ID (ex. “it2”, “theincredibles2”)
-
Returns
Release ID (ex. “rl1107461633”, “rl2071758337”), None if none found
pymojo.pymojo.get_release_schedule(year: int | str, month: int | str, day: int | str = 1)
Parse information found on the domestic release schedule page on Box Office Mojo
-
Parameters
-
year – Year of starting date (ex. 2022)
-
month – Month of starting date (ex. 5)
-
day – Day of of starting date (ex. 6)
-
-
Returns
list of
dictof {‘title’: str, ‘release_id’: str, ‘imdb_id’: str, ‘release’: datetime, ‘scale’: str (ex. ‘limit’ or ‘wide’), ‘distributor’: str (ex. ‘walt disney studios motion pictures’ ‘poster’:poster: str (url of poster image)}
pymojo.pymojo.get_release_schedule_for_range(date_start: datetime, date_end: datetime)
Loops through enough release schedules to cover a given date range.
-
Parameters
-
date_start – datetime for start of period
-
date_end – datetime for end of period
-
-
Returns
list of dict of {
‘title’: str, ‘release_id’: str, ‘imdb_id’: str, ‘release’: datetime, ‘scale’: str (ex. ‘limit’ or ‘wide’), ‘distributor’: str (ex. ‘walt disney studios motion pictures’ ‘poster’:poster: str (url of poster image)}