Pokénet

In my previous post, I wrote about visualizing Pokémon evolution chains using a network. However, if you wanted to reproduce the results, you had to assemble the data set yourself and add a few lines of code. Hence, I decided to create this GitHub repository which let’s you quickly generate a network using Python or a Command Line Interface. Either way, you can create for example, the below pictured network.

Getting started

To get up and running, Python3.11 and poetry have to be installed. Then clone the repository and type

Bash
poetry install

to install all dependencies and the project.

Usage
Python 🐍

To generate the above network in Python (without the Pokémon pictures as nodes) create a new script with the following content:

Python
from pokenet import PokeNet

network = PokeNet()
network.create_network(pokemon_generation=3)
network.save_network()

The newly initialized instance network, already has the required data set as attribute. If you want to take a look at the data set, you can access it with network.node_data (which is simply a polars DataFrame). The parameter pokemon_generation in network.create_network() let’s you subset the data by a specified Pokémon generation and will generate a network with the filtered data. network.save_network() writes the visualization as .html to disk. All class functions have docstrings, so simply open the help page whenever you want some further information.

Note: If you want to recreate the network with Pokémon pictures as nodes, please provide a path to

Python
network.create_network(
  pokemon_generation=3, pokemon_pics_path="path/to/my/pictures"
)

This path should contain a picture for each Pokémon and the file name should match the Pokémon’s Pokédex ID. I’d recommend to download this image data set.

Command Line Interface 👨‍💻

Alternatively, you can use the CLI which works out of the box. To create the same network as with the above Python code, use:

Bash
pokenet --pokemon-generation 3

To get some help on the arguments that you can provide, type:

Bash
pokenet --help
Summary

Pokenet let’s you easily create an interactive network with Pokémon evolution chains. In my opinion, it is a unique way to visualize the underlying data. If you have any ideas to enhance this project (in form of features, bug fixes, etc.), feel free to message me, open an issue or pull request!

-Jakob