diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 00000000..063f9b6f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,51 @@ +name: β€‹πŸž Bug +description: Report an issue to help us improve the project. +title: '[BUG] ' +labels: ["bug"] +body: + - type: textarea + attributes: + label: Description + id: description + description: A brief description of the issue or bug you are facing, also include what you tried and what didn't work. + validations: + required: false + - type: textarea + attributes: + label: Screenshots + id: screenshots + description: Please add screenshots if applicable + validations: + required: false + - type: textarea + attributes: + label: Any additional information? + id: extrainfo + description: Any additional information or Is there anything we should know about this bug? + validations: + required: false + - type: dropdown + id: browsers + attributes: + label: What browser are you seeing the problem on? + multiple: true + options: + - Firefox + - Chrome + - Safari + - Microsoft Edge + - type: checkboxes + id: no-duplicate-issues + attributes: + label: 'Checklist' + options: + - label: 'I have checked the existing issues' + required: true + + - label: 'I have read the [Contributing Guidelines](https://github.com/alo7lika/Scrape-ML/blob/debugg/CONTRIBUTING.md)' + required: true + - label: "I'm a GSSoC'24-Extd contributor" + - label: "I'm a Hacktoberfest'24 contributor" + + - label: 'I am willing to work on this issue (optional)' + required: false diff --git a/.github/ISSUE_TEMPLATE/custom.yml b/.github/ISSUE_TEMPLATE/custom.yml new file mode 100644 index 00000000..4c466348 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.yml @@ -0,0 +1,70 @@ +name: "βš™οΈ Custom Issue" +description: "Submit a custom issue or suggestion for Scrape-ML ." +title: "[Custom]: " +labels: ["custom", "status: needs triage"] +body: + - type: markdown + attributes: + value: | + Thank you for submitting a custom issue for **Scrape-ML**! This template is intended for any requests or suggestions that don't fit into the bug report, feature request, or documentation categories. + + - type: input + id: issue_summary + attributes: + label: "Issue Summary" + description: "Provide a summary of the custom issue." + placeholder: "E.g., Enhancement suggestion for search functionality" + validations: + required: true + + - type: textarea + id: issue_description + attributes: + label: "Issue Description" + description: "Describe the issue or suggestion in detail." + placeholder: "Provide a detailed description of the custom issue, including the context, use case, or scenario in which this issue occurs or would be relevant..." + validations: + required: true + + - type: textarea + id: proposed_solution + attributes: + label: "Proposed Solution (Optional)" + description: "If you have any ideas or suggestions for how to address this issue, describe them here." + placeholder: "Describe your proposed solution or approach..." + + - type: dropdown + id: priority + attributes: + label: "Priority" + description: "How important is this issue to you?" + options: + - "High - Requires urgent attention" + - "Medium - Should be addressed soon" + - "Low - Can be addressed later" + validations: + required: true + + - type: checkboxes + id: category + attributes: + label: "Category" + description: "Select the category that best describes the issue." + options: + - label: "Enhancement" + - label: "Refactor" + - label: "Security" + - label: "Design" + - label: "Other" + + - type: textarea + id: additional_context + attributes: + label: "Additional Context (Optional)" + description: "Add any other context or information that might be relevant to this issue." + placeholder: "Provide any extra details, screenshots, or references that could help with understanding the issue..." + + - type: markdown + attributes: + value: | + **Thank you for your suggestion!** We appreciate your input and will review your custom issue promptly. πŸ“ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31377252..70ee0d2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,112 +1,295 @@ -# Contributing to Scrape-ML +# Contributing to Scrape-ML 🎯 Thank you for considering contributing to Scrape-ML! We welcome all types of contributionsβ€”bug reports, feature suggestions, documentation improvements, and code contributions. To make the process smooth, please follow the guidelines below. -## Table of Contents -1. [Code of Conduct](https://github.com/recodehive/Scrape-ML/blob/main/CODE_OF_CONDUCT.md) -2. [How to Contribute](#how-to-contribute) - - [Reporting Bugs](#reporting-bugs) - - [Suggesting Enhancements](#suggesting-enhancements) - - [Submitting Code Changes](#submitting-code-changes) -3. [Pull Request Process](#pull-request-process) -4. [Development Environment Setup](#development-environment-setup) +
-## Code of Conduct -By participating in this project, you agree to uphold our [Code of Conduct](CODE_OF_CONDUCT.md). Please ensure that your contributions are respectful and considerate of others. +# Code of Conduct πŸ“ƒ -## How to Contribute +By participating in this project, you agree to uphold our [Code of Conduct](https://github.com/recodehive/Scrape-ML/blob/main/CODE_OF_CONDUCT.md). Please ensure that your contributions are respectful and considerate of others. -### Reporting Bugs -If you find a bug, please open an issue in our repository. When reporting a bug, provide as much detail as possible, including: -- The version of Python you’re using. -- Steps to reproduce the issue. -- Screenshots or error logs, if available. +
-### Suggesting Enhancements -We are open to feature suggestions and improvements! If you have an idea for enhancing the project, please open an issue with: -- A clear and concise description of the suggested feature. -- How it would be beneficial to the project. -- Any potential implementation details you have in mind. +#

Star our Repository ⭐

+ +###
[![Stars](https://img.shields.io/github/stars/recodehive/Scrape-ML?style=for-the-badge&logo=github)](https://github.com/recodehive/Scrape-ML/stargazers) [![Forks](https://img.shields.io/github/forks/recodehive/Scrape-ML?style=for-the-badge&logo=github)](https://github.com/recodehive/Scrape-ML/network/members) [![Issues](https://img.shields.io/github/issues/recodehive/Scrape-ML?style=for-the-badge&logo=github)](https://github.com/recodehive/Scrape-ML/issues) [![PRs Open](https://img.shields.io/github/issues-pr/recodehive/Scrape-ML?style=for-the-badge&logo=github)](https://github.com/recodehive/Scrape-ML/pulls) [![PRs Closed](https://img.shields.io/github/issues-pr-closed/recodehive/Scrape-ML?style=for-the-badge&logo=github&color=2cbe4e)](https://github.com/recodehive/Scrape-ML/pulls?q=is%3Apr+is%3Aclosed)
+ +
-### Submitting Code Changes +# Table of Contents +1. [Code of Conduct](#code-of-conduct) +2. [Project Structure](#project-structure-) +3. [How to Contribute](#how-to-contribute) + - [First Pull Request](#first-pull-request-) + - [Alternate Method To Contribute](#alternatively-contribute-using-github-desktop-️) + - [Pull Request Process](#pull-request-process-) + - [Reporting Bugs](#reporting-bugs-) + - [Suggesting Enhancements](#suggesting-enhancements-) +4. [Development Environment Setup](#development-environment-setup-) +5. [Help And Support](#for-help-and-support-) +6. [Good Coding Practices](#good-coding-practices-) -1. **Fork the repository:** - - Click the "Fork" button in the top right corner of the repository page on GitHub. +
-2. **Clone the forked repository locally:** -```sh - git clone https://github.com/your-username/Scrape-ML.git - cd scrape-ml +# Project Structure πŸ“‚ + +```bash +SCRAPE-ML/ +β”œβ”€β”€ .github/ # GitHub-related configurations such as workflows, issue templates, etc +β”‚ +β”œβ”€β”€ .ipynb_checkpoints/ # The movie review part is included here +β”‚ +β”œβ”€β”€ .vscode/ # The settings.json file is included here +β”‚ +β”œβ”€β”€ IMDB/ # IMDB related trained files are here +β”‚ +β”œβ”€β”€ Movie Genre Classification/ # Movie genre classification file of python is included here +β”‚ +β”œβ”€β”€ Smart_select features/ # Some .py files are included here +β”‚ +β”œβ”€β”€ Tesseract-OCR/ # Some .html and .exe files are included here +β”‚ +β”œβ”€β”€ Web_app/ # All the resources used in the web app are included here +β”‚ +β”œβ”€β”€ assets/ # All the assets like images in the project are included here +β”‚ +β”œβ”€β”€ backlog/ # All the .ipynb files are included here +β”‚ +β”œβ”€β”€ data_scrapped # Some .csv files are included here +β”œβ”€β”€ +β”œβ”€β”€ .gitignore +β”œβ”€β”€ +β”œβ”€β”€ CODE_OF_CONDUCT.md # Some rules for the contributors +β”œβ”€β”€ +β”œβ”€β”€ CONTRIBUTING.md # Instructions for the contributors +β”œβ”€β”€ +β”œβ”€β”€ LICENSE # A permission to do something +β”œβ”€β”€ +β”œβ”€β”€ Learn.md +β”œβ”€β”€ +β”œβ”€β”€ Movie_review_imdb_scrapping.ipynb +β”œβ”€β”€ +β”œβ”€β”€ Movie_review_rotten_tomatoes.ipynb +β”œβ”€β”€ +β”œβ”€β”€ README.md # Some instructions related to the project +β”œβ”€β”€ +β”œβ”€β”€ image-1.png +β”œβ”€β”€ +β”œβ”€β”€ image-2.png +β”œβ”€β”€ +β”œβ”€β”€ image.png +β”œβ”€β”€ +β”œβ”€β”€ main.py # The main python file of the project +β”œβ”€β”€ +β”œβ”€β”€ results.csv # The results containing file of the project ``` -4. **Create a new branch for your changes:** -```sh -git checkout -b your-feature-branch +
+ +# How to Contribute πŸ’ͺ + +## First Pull Request ✨ + +1. **Star this repository** + Click on the top right corner marked as **Stars** at last. + +2. **Fork this repository** + Click on the top right corner marked as **Fork** at second last. + +3. **Clone the forked repository** + +```bash +git clone https://github.com//Scrape-ML.git ``` + +4. **Navigate to the project directory** -5. **Make your changes:** - -* Ensure code quality and update documentation as necessary. +```bash +cd Scrape-ML +``` -6. **Test your changes thoroughly:** +5. **Create a new branch** -* Run existing tests and verify that everything works as expected. +```bash +git checkout -b +``` -7. **Commit your changes with a descriptive message:** +6. **To make changes** -```sh +```bash git add . -git commit -m "Add a brief description of the changes made" ``` -8. **Push to your fork and submit a pull request:** +7. **Now to commit** -```sh -git push origin your-feature-branch +```bash +git commit -m "add comment according to your changes or addition of features inside this" ``` -9. **Go to the original repository on GitHub and click on "New Pull Request."** -* Select your branch from the dropdown and create the pull request. +8. **Push your local commits to the remote repository** + +```bash +git push -u origin +``` + +9. **Create a Pull Request** + +10. **Congratulations! πŸŽ‰ you've made your contribution** + +## Alternatively, contribute using GitHub Desktop πŸ–₯️ + +1. **Open GitHub Desktop:** + Launch GitHub Desktop and log in to your GitHub account if you haven't already. + +2. **Clone the Repository:** +- If you haven't cloned the project repository yet, you can do so by clicking on the "File" menu and selecting "Clone Repository." +- Choose the project repository from the list of repositories on GitHub and clone it to your local machine. + +3.**Switch to the Correct Branch:** +- Ensure you are on the branch that you want to submit a pull request for. +- If you need to switch branches, you can do so by clicking on the "Current Branch" dropdown menu and selecting the desired branch. + +4. **Make Changes:** +- Make your changes to the code or files in the repository using your preferred code editor. -## Pull Request Process +5. **Commit Changes:** +- In GitHub Desktop, you'll see a list of the files you've changed. Check the box next to each file you want to include in the commit. +- Enter a summary and description for your changes in the "Summary" and "Description" fields, respectively. Click the "Commit to " button to commit your changes to the local branch. + +6. **Push Changes to GitHub:** +- After committing your changes, click the "Push origin" button in the top right corner of GitHub Desktop to push your changes to your forked repository on GitHub. + +7. **Create a Pull Request:** +- Go to the GitHub website and navigate to your fork of the project repository. +- You should see a button to "Compare & pull request" between your fork and the original repository. Click on it. + +8. **Review and Submit:** +- On the pull request page, review your changes and add any additional information, such as a title and description, that you want to include with your pull request. +- Once you're satisfied, click the "Create pull request" button to submit your pull request. + +9. **Wait for Review:** +Your pull request will now be available for review by the project maintainers. They may provide feedback or ask for changes before merging your pull request into the main branch of the project repository. + +## Pull Request Process πŸš€ - Ensure your code follows the existing code style. - Update documentation as needed. - Verify that all existing tests pass and write new tests for new features. - Mention the issue your pull request addresses (if applicable). -## Development Environment Setup +## Reporting Bugs πŸ“Œ + +If you find a bug, please open an issue in our repository. When reporting a bug, provide as much detail as possible, including: +- To open issue, go here :- [Issue](https://github.com/recodehive/Scrape-ML/issues/new/choose) +- Please kindly choose the appropriate template according to your issue. +- The version of Python you’re using. +- Steps to reproduce the issue. +- Screenshots or error logs, if available. + +## Suggesting Enhancements 🌐 + +We are open to feature suggestions and improvements! If you have an idea for enhancing the project, please open an issue with: +- A clear and concise description of the suggested feature. +- How it would be beneficial to the project. +- Any potential implementation details you have in mind. + +
+ +# Development Environment Setup πŸ”§ To contribute to Scrape-ML, follow these steps to set up your development environment: -### Prerequisites +## Prerequisites + - Python 3.7 or higher - [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) - [Requests](https://docs.python-requests.org/en/latest/) - Jupyter Notebook -### Setup Instructions +## Setup Instructions + 1. Clone the repository: - ```sh - git clone https://github.com/your-username/scrape-ml.git + + ```bash + git clone https://github.com/your-username/Scrape-ML.git ``` -2. Create and activate a virtual environment: - ```sh + +3. Create and activate a virtual environment: + + ```bash python -m venv env - source env/bin/activate # For Linux/macOS + ``` + + ```bash .\env\Scripts\activate # For Windows ``` -3. Install the dependencies: - ```sh + + ```bash + source env/bin/activate # For Linux/macOS + ``` + +4. Install the dependencies: + + ```bash pip install -r requirements.txt ``` -4. Launch Jupyter Notebook to start contributing: - ```sh + +6. Launch Jupyter Notebook to start contributing: + ```bash jupyter notebook ``` -## Additional Guidelines +
+ +# For Help And Support πŸ’¬ + +- Admin Github Profile:- [Sanjay Viswanathan](https://github.com/sanjay-kv) +- Contact :- [Topmate](https://topmate.io/sanjaykv/) + +
+ +# Good Coding Practices πŸ§‘β€πŸ’» + +1. **Follow the Project's Code Style** + + - Maintain consistency with the existing code style (indentation, spacing, comments). + - Use meaningful and descriptive names for variables, functions, and classes. + - Keep functions short and focused on a single task. + - Avoid hardcoding values; instead, use constants or configuration files when possible. + +2. **Write Clear and Concise Comments** + + - Use comments to explain why you did something, not just what you did. + - Avoid unnecessary comments that state the obvious. + - Document complex logic and functions with brief explanations to help others understand your thought -process. + +3. **Keep Code DRY (Don't Repeat Yourself)** + + - Avoid duplicating code. Reuse functions, methods, and components whenever possible. + - If you find yourself copying and pasting code, consider creating a new function or component. + +4. **Write Tests** + + - Write unit tests for your functions and components. + - Ensure your tests cover both expected outcomes and edge cases. + - Run tests locally before making a pull request to make sure your changes don’t introduce new bugs. + +5. **Code Reviews and Feedback** + + - Be open to receiving constructive feedback from other contributors. + - Conduct code reviews for others and provide meaningful suggestions to improve the code. + - Always refactor your code based on feedback to meet the project's standards. + +
+ +# Additional Guidelines πŸ“– - Make sure to follow clean coding practices. - Add comments wherever necessary for better code understanding. - If you are adding new functionality, update the documentation in the README. -We are excited to see your contributions and collaborate with you! +
+ +# Thank you for contributing πŸ’— + +We truly appreciate your time and effort to help improve our project. Feel free to reach out if you have any questions or need guidance. Happy coding! πŸš€ + +## diff --git a/README.md b/README.md index 1ccb46a5..95e282e7 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,25 @@ - `convert_texts_to_csv.ipynb` - The scraped data is saved into a CSV file, allowing for easy import into data analysis software or further processing. The CSV format ensures compatibility with a wide range of tools and platforms, making it convenient to incorporate the scraped data into various workflows and projects. πŸ’ΎπŸ’Ό + + + + + +## This project is now OFFICIALLY accepted for + +
+ GSSoC 2024 Extd +
+ +
+ Hacktober fest 2024 +
+ + + + + ## Getting Started @@ -132,7 +151,7 @@ pip install -r requirements.txt 3. Run the Streamlit app ``` -streamlit run streamlit_app.py +streamlit run Home_Page.py ``` **Uploading the CSV file** @@ -143,6 +162,49 @@ When prompted by the app, upload a CSV (comma separated value) file containing t Streamlit app link: https://scrape-review-analysis.streamlit.app +## Contribution πŸŽ‰ + + + πŸŽ‰ + +Contributions are welcome! If you have any suggestions for improvements or new features, please feel free to submit a pull request. Your contributions help make this project better for everyone. + + + πŸš€ + + +
+

+ + + πŸ”₯ + + Contribution +

+
+ +

This project thanks all the contributors for their valuable contributions to our project

+
+ +
+ + + +
+
+ +## πŸ’— Stargazers + +
+ [![Stargazers repo roster for @recodehive/Scrape-ML](https://reporoster.com/stars/recodehive/Scrape-ML)](https://github.com/recodehive/Scrape-ML/stargazers) +
+ +## πŸ’— Forkers + +[![Forkers repo roster for @recodehive/Scrape-ML](https://reporoster.com/forks/recodehive/Scrape-ML)](https://github.com/recodehive/Scrape-ML/network/members) + +![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png) + ## Final Dataset πŸ”¬Here is the Link to **Final Dataset:** [Drive Link](https://drive.google.com/file/d/1sTNAeuy-99Hao0V5AOVznLXyDJC2zuFn/view?usp=sharing) containing the scraped IMDb movie reviews. This dataset can be used for analysis, research, or any other purposes you require. πŸ“¦ diff --git a/Web_app/Home_Page.py b/Web_app/Home_Page.py index e05685b8..65002c70 100644 --- a/Web_app/Home_Page.py +++ b/Web_app/Home_Page.py @@ -83,7 +83,7 @@ .animated-header { animation: fadeIn 2s; font-size: 24px; - color: #f39c12; + color: black; text-align: center; } diff --git a/Web_app/pages/Favorite_Movie.py b/Web_app/pages/Favorite_Movie.py new file mode 100644 index 00000000..bd15977f --- /dev/null +++ b/Web_app/pages/Favorite_Movie.py @@ -0,0 +1,325 @@ +import streamlit as st +import requests +import time +from datetime import datetime +import json + +# Initialize session state for favorites +if "favorites" not in st.session_state: + st.session_state.favorites = set() + +# TMDB API Configuration +API_KEY = "Imdb_api_key" +BASE_URL = "https://api.themoviedb.org/3" + + +def fetch_movies(list_type="trending"): + """Fetch movies from TMDB API""" + if list_type == "trending": + url = f"{BASE_URL}/trending/movie/week?api_key={API_KEY}" + else: + url = f"{BASE_URL}/movie/popular?api_key={API_KEY}" + + try: + response = requests.get(url) + return response.json()["results"] if response.status_code == 200 else [] + except: + st.error("Failed to fetch movies") + return [] + + +# Page Configuration +st.set_page_config(page_title="Movie Collection", page_icon="🎬", layout="wide") + +# Custom CSS for the new compact design +st.markdown( + """ + + """, + unsafe_allow_html=True, +) + +# Header +st.markdown( + """ +
+

🎬 Movie Collection

+

Discover and collect your favorite movies

+
+ """, + unsafe_allow_html=True, +) + +# Filter Section +col1, col2, col3 = st.columns([1, 1, 1]) +with col1: + show_favorites = st.checkbox("Show Favorites", key="show_favorites") +with col2: + sort_by = st.selectbox( + "Sort by", ["Rating", "Release Date", "Title"], key="sort_by" + ) +with col3: + list_type = st.selectbox("List Type", ["Trending", "Popular"], key="list_type") + +# Fetch and process movies +movies = fetch_movies(list_type.lower()) + +# Filter favorites if needed +if show_favorites: + movies = [m for m in movies if m["id"] in st.session_state.favorites] + +# Sort movies +if sort_by == "Rating": + movies.sort(key=lambda x: x["vote_average"], reverse=True) +elif sort_by == "Release Date": + movies.sort(key=lambda x: x["release_date"], reverse=True) +else: + movies.sort(key=lambda x: x["title"]) + +# Display movies +if not movies: + st.markdown( + """ +
+

No movies found

+

Try adjusting your filters or check back later for new movies.

+
+ """, + unsafe_allow_html=True, + ) +else: + for movie in movies: + # Create columns for layout + movie_id = movie["id"] + is_favorite = movie_id in st.session_state.favorites + + # Movie card HTML + st.markdown( + f""" +
+
+ {movie['title']} +
+
+
+
{movie['title']}
+
+ {movie['release_date'][:4]} + β˜… {movie['vote_average']:.1f} +
+
+
+
+ {'❀️' if is_favorite else '🀍'} + +
+
+ """, + unsafe_allow_html=True, + ) + + # Toggle favorite button + if st.button( + f"{'Remove from' if is_favorite else 'Add to'} Favorites", + key=f"toggle_{movie_id}", + ): + if is_favorite: + st.session_state.favorites.remove(movie_id) + else: + st.session_state.favorites.add(movie_id) + st.experimental_rerun() + +# JavaScript for interactivity +st.markdown( + """ + +