0% found this document useful (0 votes)
4 views

Project_Report

The project report outlines the development of a Python-based movie and series management application designed to help users organize their favorite titles efficiently. It utilizes a dataset from Kaggle, allowing users to browse movies, view details, and save favorites to an Excel file while incorporating features like pagination and error handling. The application aims to enhance user experience and has potential for further enhancements such as search filters and sorting options.

Uploaded by

Joao Pedro
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Project_Report

The project report outlines the development of a Python-based movie and series management application designed to help users organize their favorite titles efficiently. It utilizes a dataset from Kaggle, allowing users to browse movies, view details, and save favorites to an Excel file while incorporating features like pagination and error handling. The application aims to enhance user experience and has potential for further enhancements such as search filters and sorting options.

Uploaded by

Joao Pedro
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Project Report

Netflix favorite list

Joao Pedro Schneidr Perondi

Group 7
In today's digital era, managing and organizing a personalized movie
watchlist can be confusing. Users often struggle to keep track of their
favorite movies and find relevant details, such as genre, release year, and
IMDb ratings. This project aims to solve this problem by providing a Python-
based movie/series management application that allows users to view,
select, and store their favorite shows in a structured and reusable format.

Dataset: The project utilizes a dataset stored in an Excel file


(data.xlsx), which contains details about movies and series, including their
titles, genres, release years, IMDb ratings, and other descriptive attributes.
This dataset was taken from Kaggle.

How it works
1. show_movies()

The show_movies function is designed to display a list of movie titles in


a user-friendly, paginated format, enabling navigation through pages of
movies and allowing the user to select a movie by entering its corresponding
number. This approach ensures that even large datasets can be explored
efficiently without overwhelming the user with too much information at once.

Extracting Movie Titles:

The function begins by extracting the titles from the first column of an
Excel dataset. It iterates over each row in the column, starting from the
second row (to skip headers), and stores the titles in a list named titles.

Display Logic:

To handle the potentially large number of movies, the function implements


pagination. Initially, the first 50 movies are displayed, with the user having
the option to navigate forward ("Next") or backward ("Back") through
additional pages:

 First Page: If the user is on the first page, only the "Next" option is
available for navigation.
 Middle Pages: If the user is in the middle of the list, both "Next" and
"Back" options are provided to navigate forwards or backwards.
 Last Page: When the user reaches the last page, only the "Back"
option is available.
Handling User Input:

The function waits for user input to determine the next action:

 Selecting a Movie: If the user enters a number within the current


range (choice_range_min to choice_range_max), the function interprets
this as a selection and returns the corresponding index from the titles
list.

 Invalid Input: If the user enters an invalid command or an out-of-


range number, the function prompts them to enter a valid option.

Returning the Selected Movie Index:

Once a valid movie number is selected, the function returns an integer


representing the index of the chosen movie in the titles list. This value is
crucial for further processing in subsequent functions, such as
show_descriptions, where the movie's details are retrieved and displayed.

2. Show_descriptions()

The show_descriptions function retrieves and displays detailed


information about a specific movie selected by the user from the movie list.
Additionally, it allows the user to decide whether they want to add the movie
to their favorites list. It plays a key role in transitioning from browsing the list
of movies (show_movies) to interacting with a specific movie's details

Extracting Movie Details:

The function begins by preparing a list called descriptions, which contains all
the relevant data from the dataset. Each row of the dataset corresponds to a
movie, and the columns represent various attributes, such as the movie's
title, genre, release year, and IMDb rating.

 This is achieved by iterating over the rows in the dataset, starting from
the second row (to skip headers), and appending each row to the
descriptions list. Each row is stored as a tuple of values.
Displaying the Selected Movie's Details:

The function takes an integer i as input, representing the index of the movie
selected in the show_movies function. Using this index, it retrieves the
corresponding movie's details from the descriptions list.

 The following details are displayed to the user:


o Type: The movie's type or category (like series).
o Genre: The primary genre of the movie (Action, Drama, etc).
o Release Year: The year the movie was released.
o IMDb Average: The average IMDb rating for the movie.

Prompting User Interaction:

After displaying the movie's details, the function asks the user whether they
want to add this movie to their favorites list:

 Yes: If the user chooses "Yes," the function creates a new list, movie,
containing only the movie's title, type, genre, release year, and IMDb
rating. This list is then returned to the caller, signaling that the movie
has been added to the favorites list.
 No: If the user chooses "No," the function exits without adding the
movie to the favorites list and returns None.

Returning the Selected Movie Data:

When a movie is successfully added to the favorites list, the function


returns a list containing its details. This list is used in subsequent functions,
such as favorite_add, to save the movie to the user's favorites file. If the user
opts not to add the movie, the function returns None, allowing the program
to proceed with other operations.

3. Favorite_add
The favorite_add function saves the user's selected favorite movies to
an Excel file named favorite_movies.xlsx. It ensures data persistence by
creating or updating the file with the user's favorites while avoiding duplicate
entries. This function is critical for maintaining a structured record of movies
the user has chosen.

File and Sheet Initialization:

 File Name and Sheet Name:


The function defines the target file name as favorite_movies.xlsx and
the target sheet name as "Favorites".
 Headers:
A predefined list of column headers (["Title", "Genre", "Year", "IMDB
Average"]) is set to ensure consistency in the saved data's structure.

Loading or Creating the Workbook:

 The function attempts to open the file favorite_movies.xlsx using the


load_workbook method from the openpyxl library.

Error Handling:
If the file does not exist or cannot be loaded, the function catches the
exception, prints an error message, and creates a new workbook from
scratch. The default sheet is renamed to "Favorites".

Selecting or Creating the Sheet:

 If the sheet "Favorites" already exists in the workbook, it is accessed.


 If the sheet does not exist, it is created dynamically.

Adding Headers to the Sheet:

 The function checks whether the sheet is empty (no existing rows or
cells are populated).
 If empty, the header row is added at the top to label the columns. This
ensures consistency in the structure of the data.

Avoiding Duplicate Entries:

 The function reads all existing rows in the sheet and converts them
into a set of tuples (existing_data).
 Before appending a new movie, it checks if the movie (represented as
a tuple of its details) is already in existing_data. This prevents
duplicate entries.

Appending Movies to the Sheet:

 Each movie in the favorite_list parameter (provided as input) is


checked for duplicates.
 Only movies with valid, non-empty data are appended to the sheet.

Saving the Workbook:

 After updating the sheet with new movies, the workbook is saved back
to favorite_movies.xlsx.
 If there is an issue during saving, the function catches the exception
and prints an error message.

Feedback to the User:

 The function provides clear feedback, notifying the user whether the
favorites were successfully saved or if an error occurred during the
process.

Main

The main function is the central hub of the application, responsible for
managing user interactions and orchestrating the flow of operations. It
provides users with three main options:

1. Display Movie List


2. View Favorite Movie List
3. Delete Favorite Movie List

1. Initial Menu Display:


a. Users are presented with three choices via a text menu.
b. Their input determines the next action:

Option 1: Display the movie list and allow users to search for
movies to add to their favorites.
Option 2: Display the current list of favorite movies stored in an
Excel file.
Option 3: Delete the Excel file containing the favorite movies.

2. Movie Search and Favorites Handling:


a. If users choose Option 1, the program invokes show_movies to
display paginated movie titles.

b. The selected movie’s details are fetched via show_descriptions.

c. Users can decide to add the movie to their favorites or continue


searching.

d. Favorites are saved to an Excel file using favorite_add, and users


can view their updated list via display_favorites.

3. View Favorites:

a. Option 2 directly calls display_favorites to show the user's saved


favorite movies.

4. Delete Favorites File

a. Option 3 checks if the favorite_movies.xlsx file exists and deletes


it if found, providing confirmation. If the file is missing, the
program informs the user.
5. Loop and Input Validation:

a. The program ensures users provide valid input for menu


navigation and movie selection, prompting them until a correct
choice is made.

Results and conclusions

The result of this project is a program capable of searching


through a large number of titles and display their characteristics in an
easy and straightforward manner, capable of handling multiple user
inputs and managing the outcomes in a safe way so the program
doesn’t break or act in an unexpected manner, being able to store the
user choices and display them later as an excel file.
Containing key features such as paginated browsing, user-
friendly prompts, and dynamic saving of favorite movies to an Excel
file, highlight the project's focus on usability and efficiency, containing
error handling as well, with potential to being updated to have features
likes a search filter, sorting options, etc.

In conclusion, this project showcases the ability to design and


implement an interactive Python-based application, making it an
excellent foundation for more complex systems in data analysis, user
engagement, or entertainment-related applications.

Appendix

from openpyxl import Workbook, load_workbook


import openpyxl

from Methods import show_movies, show_descriptions,


favorite_add, display_favorites
import os

You might also like