How many percent of all pokemons of type 'fire' are red compared to green, blue or any other color? That's what the project contained in this repo is all about! By fetching all the data from the pokeapi into a duckdb database, transforming the data using dbt into a clean, well structured table suitable for our task, we finally produce insights into how the color of the pokèmons relate to its type.
- Clone repository:
git clone https://github.com/coffeeBeansz/pokemon_insights.git
- Install python and pip:
sudo apt install python3 python3-pip
- Create a virtual environment and install the requirements to it:
pip install -r requirements.txt
- Put a file named profiles.yml in the folder ~/.dbt/ conatining the following:
dbt_project:
outputs:
dev:
type: duckdb
path: <path_to_repo>/pokeapi_database.duckdb
threads: 1
prod:
type: duckdb
path: <path_to_repo>/pokeapi_database.duckdb
threads: 4
target: dev
where <path_to_repo> should be replaced by the path to the github repo on your computer.
- To fetch raw data from pokeapi, cd to repo and run:
python3 extract_raw.py
- To prepare the data, cd to the dbt_project inside your repo and run:
dbt run
- To create the insights, cd to repo and run:
python3 main.py
The folder result_figures will be created, and the insights are placed in this folder.