This project is a Python-based application for fetching YouTube video reviews and descriptions, built with FastAPI, a modern, fast web framework for building APIs with Python.
- Integrated Google Cloud Translate API for multilingual support.
- Implemented CLI functionality for review fetching using video IDs or search terms.
- Utilized GitHub Actions for CI, ensuring code quality through automated testing.
-
download the project to your machine
git clone [email protected]:COSC381-2023Fall/final-project-Luna-Jia.git
-
at the project directory, create vertual enviroment
python3 -m venv .venv
-
run vertual enviroment
source .venv/bin/activate
-
make sure pip is pointing to the right path
which pip
-
To install the dependencies in batch(set up a virtual environement), run the command:
python3 -m pip install -r requirements.txt
-
To run the fast API application, use the following command:
uvicorn main:app --reload
-
In the browser, go to http://127.0.0.1:8000, the webpage will return a JSON response:
{"Hello": "world"}
-
Run test, in termial, type
pytest --cov=.
-
run
youtube.py
to see 10 reviews for movie "Inception", in terminal, type:python youtube.py "Inception"
-
To run the fast API application, and search for 10 reviews/comments for a movie, in the web browser, type:
http://127.0.0.1:8000/moviereviews/<movie name>
. For example, to search reviews for movie Inception, go to: http://127.0.0.1:8000/moviereviews/Inception -
To retrieve the description of a specific video by its ID, in terminal, type:
python youtube.py --description "VIDEO_ID"
-
To test for different API endpoints, go to FastAPI Doc in your browser.