Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Latest commit

 

History

History
53 lines (51 loc) · 2 KB

README.md

File metadata and controls

53 lines (51 loc) · 2 KB

TMDB Movie Guide

The repository consists of the scripts that work with TMDB's API. For thorough description of how to use a particular script, run the script with -h option.

The scripts require Python 3.5 to run. Some of them require the user to have a working v.3 API key obtained from TMDB.

budget.py

The script retrieves movie's budget. Example usage:

$ python3 budget.py 215
TMDB API key:
The budget of the movie 'Saw II' is $4000000.

Here, 215 is the id of the movie on TMDB.

fetch.py

The script retrieves various info about random movies and saves it into a file. Note that in order to comply with the EULA you should delete the files in a couple of days. Example usage:

$ python3 fetch.py 1000 -o test.json
TMDB API key:
test.json already exists. Rewrite? [y/n]: y
Downloading ids...
Getting additional info...
Writing to a json-file...
Done!

Here, 1000 is the number of movies to save in a test.json file. In this case, the file already exists, but we decide to overwrite it. By default everything is saved into movies.json.

This script may take a long time to execute.

search.py

The script finds all movie titles with the parameter as a substring. Example usage:

$ python3 search.py 'xxx' -i test.json
Results:
xXx: Return of Xander Cage

Here, 'xxx' is the substring to search and test.json is a json file retrieved with fetch.py (by default, it's 'movie.json').

recommend.py

The script suggests a list of movies to watch based on the movie title provided. The movie must be in the database. Example usage:

$ python3 recommend.py 'Monsters, Inc.' -t 7 -i test.json
Recommendations:
Monsters University
Toy Story 3
Inside Out
Cars
Finding Nemo
Finding Dory
Brave

Here, 'Monsters, Inc.' is the movie upon which the suggestions are based. '7' is the number of suggested movies and 'test.json' is a json file retrieved with fetch.py (again, it's 'movies.json' by default).

Purpose

This is a homework assignment for styleru_py course.