git clone https://github.com/kjahan/six-degrees.git
You should download The Movies Dataset and store it locally under the repo folder. Unzip the dataset file and rename its folder to movies-dataset
.
To create, activate and deactivate Conda environment:
conda env create -f environment.yml
$ conda activate bacon
$ conda deactivate
If you encouter AttributeError: module 'enum' has no attribute 'IntFlag'
on MacOS, simply run unset PYTHONPATH
command in your terminal.
To run the movies data pipeline you need to switch to where you cloned the repo code. To load and parse movies data, constructing the movie-actor bipartite graph, running BFS to compute bacon numbers, and saving the outcome results to disk: python -m src.run
.
You need to run the above step before triggering api calls to the server!
To run unit tets run pytest
from the repo root folder.
Start the HTTP server for handling the api calls and returning the bacon number: python -m src.server
To test the HTTP server for "Ronald Reagan" and "Kevin Bacon", open the browser of your choice on your machine and try the following URLs. You shold get bacon number of two for "Ronald Reagan" and zero for "Kevin Bacon".