Skip to content

coffeeBeansz/pokemon_insights

Repository files navigation

Pokèmon insights

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.

Distribution of colors for pokèmons of type fire. Distribution of colors for pokèmons of type ice.

How to run the code:

  1. Clone repository:
git clone https://github.com/coffeeBeansz/pokemon_insights.git
  1. Install python and pip:
sudo apt install python3 python3-pip
  1. Create a virtual environment and install the requirements to it:
pip install -r requirements.txt
  1. 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.

  1. To fetch raw data from pokeapi, cd to repo and run:
python3 extract_raw.py
  1. To prepare the data, cd to the dbt_project inside your repo and run:
dbt run
  1. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages