This is a very simple command-line movie recommender written in Python.
It stores users and their favorite movies in a JSON file (users.json) and recommends movies to a user based on the most similar existing user.
simple-movie-recommender/
βββ recommender.py # main script (CLI)
βββ users.json # users and their favorite movies (created/updated at runtime)
βββ README.md- The program asks for your name.
- If you already exist in
users.json, it loads your favorite movies. - If you are a new user, it asks you to enter 2 or 3 favorite movies and saves them.
- Then it finds the user with the most shared movies with you.
- Finally, it recommends the movies that the matched user likes but you haven't watched yet.
- Users are stored as:
{ "Ali": ["Inception", "Matrix"], "Sara": ["Titanic", "Inception"] }
- Similarity is computed by set intersection of movie titles (case-insensitive).
- If multiple users have the same similarity score, the one with lexicographically smaller name is chosen.
python recommender.pyThen follow the prompts in the terminal.
- If users.json exists β it loads it.
- If it does not exist β it uses default users defined in the code and will create the file after first new user is added.
- Python 3.8+
- No external libraries (only json, pathlib, time from stdlib)