PokeAPI Data Processor is a tool for gathering Pokémon data from the PokeAPI and generating statistical results.
This tool is able to:
- Group Pokémon by their types (e.g., water, fire) and abilities.
- Count the number of Pokémon in each group.
- Calculate the average base experience for each type of Pokémon.
- Calculate the total number of unique abilities for each type of Pokémon.
-
Clone the Repository: Open your terminal and run the following command to clone the GitHub repository to your local machine:
git clone https://github.com/ValdonVitija/PokeAPI-Data-Processor.git
-
Navigate to the Repository:
cd PokeAPI-Data-Processor
-
Create a virtual environment in the root of the project's directory
python3 -m venv .venv
-
Active your virtual environment
source .venv/bin/activate #Linux/Mac based ------------------------------------------ .\.venv\Scripts\activate #Windows based
-
Install requirements in your virtual environment
pip3 install -r requirements.txt
-
Run the app
python3 -m src.main
You will see something like this:
/> python3 -m src.main _ _ __ ___ | | _____ _ __ ___ ___ _ __ | '_ \ / _ \| |/ / _ \ '_ ` _ \ / _ \| '_ \ | |_) | (_) | < __/ | | | | | (_) | | | | | .__/ \___/|_|\_\___|_| |_| |_|\___/|_| |_| _ _|_| _ __| | __ _| |_ __ _ _ __ _ __ ___ ___ ___ ___ ___(_)_ __ __ _ / _` |/ _` | __/ _` | | '_ \| '__/ _ \ / __/ _ \/ __/ __| | '_ \ / _` | | (_| | (_| | || (_| | | |_) | | | (_) | (_| __/\__ \__ \ | | | | (_| | \__,_|\__,_|\__\__,_| | .__/|_| \___/ \___\___||___/___/_|_| |_|\__, | |_| |___/ BY : VALDON VITIJA fetching all pokemons: 100%|███████████████████████████████████████████████████████████████████████████| 1302/1302 [00:13<00:00, 95.04pokemon/s] creating dataframe for pokemons: 44%|████████████████████████████▋ | 567/1302 [02:28<04:45, 2.58pokemon/s]
.
├── LICENSE #Software License.
├── README.md #Contains the projects viewable documentation
├── pokeapi_logo.png #The logo of the project
├── pytest.ini #pytest configuration file.
├── requirements.txt #Contains project dependecies.
├── results #The generated results will be stored here
│ ├── csv
│ │ ├── avg_base_experience.csv
│ │ ├── pokemon_group_counts.csv
│ │ └── unique_abilities_count.csv
│ └── visual
│ ├── avg_base_experience.png
│ ├── pokemon_barplot_interactive.html
│ └── unique_abilities_count.png
├── src #contains the entire source code, modularized into python modules
│ ├── __init__.py #convert directory to a python pacakge
│ ├── api_connector.py #the interface towards the pokeapi
│ ├── data_processing.py #data structuring and processing
│ ├── main.py #the entryo point of execution
│ └── result_exporters.py #saves results into different formats
├── tests #contains unit tests
│ ├── __init__.py #convert directory to a python pacakge
│ ├── conftest.py #generic module that other modules will use
│ ├── results #saved results for testing purposes
│ │ └── csv
│ │ ├── avg_base_experience.csv
│ │ ├── pokemon_group_counts.csv
│ │ └── unique_abilities_count.csv
│ ├── test_api_connector.py
│ ├── test_data_processing.py
│ └── test_result_exporters.py
Important
It wouldn't be resonable to just print pokemons groups based on type and ability on a graph/plot, because we group data to apply statistical functions on them and not just group them and do nothing with such groups.
Note
The graphical result on this case is an interactive graph. To interact with it open the html file in a browser and you will find the plotted graph. Do this after you have cloned the repo locally.
- Graphical: View Interactive Graph
- CSV: View CSV 📄
- Graphical: View Graph
- CSV: View CSV 📄
- Graphical: View Graph
- CSV: View CSV 📄