Skip to content

Repository files navigation

PokeExplorer

PokeExplorer is a Python exam project that allows users to explore Pokemon data through a web application.

The project uses a Streamlit frontend and a FastAPI backend. The backend fetches Pokemon data from PokeAPI, structures the data with Pydantic, performs statistics with Pandas and NumPy, and exposes API endpoints for the frontend. The application also includes an AI page where users can ask questions about a Pokemon using the OpenAI API.

Get started

Prerequisites

Before running the project, make sure you have installed:

  • Python 3.11 or 3.12
  • Docker Desktop
  • Git

Setup

  1. Clone the project:
git clone <repository-url>
cd <project-folder>
  1. Create a .env file in the project root. Use .env.example as a template

  2. Start the project with Docker Compose:

docker compose up --build
  1. Stop the project with Docker Compose:
docker compose down

Local development without Docker

  1. Create and activate a virtual environment:
python -m venv .venv
  1. Start the virtual enviroment:
.\.venv\Scripts\Activate.ps1
  1. Install dependencies:
python -m pip install -r backend/requirements.txt
python -m pip install -r frontend/requirements.txt
python -m pip install -r requirements-dev.txt
  1. Start the backend:
cd backend
python -m uvicorn app.main:app --reload --port 8001
  1. Start the frontend in another terminal:
cd frontend
python -m streamlit run app.py
  1. Run all tests and checks:
uv run pre-commit run --all-files
  1. Or run them individually:
uv run pytest
uv run ruff check .
uv run ruff format .
uv run pyright

Features

  • Search for a Pokemon by name
  • View Pokemon types, abilities, height, weight and base stats
  • Compare multiple Pokemon visually
  • Show statistics based on selected Pokemon
  • Visualize data with Matplotlib
  • Ask AI questions about a selected Pokemon
  • Run tests and code quality checks
  • Start the full application with Docker Compose

API Endpoints

GET /health GET /api/pokemon/{name} GET /api/pokemon/compare?names=pikachu,charizard GET /api/stats/summary?names=pikachu,charizard,bulbasaur POST /api/ai/ask

Technologies Used

Frontend

  • Streamlit
  • Requests
  • Pandas
  • Matplotlib

Backend

  • FastAPI
  • Pydantic
  • HTTPX
  • PokeAPI
  • OpenAI API
  • Python-dotenv

Data and Statistics

  • Pandas
  • NumPy
  • Matplotlib

Testing and Code Quality

  • pytest
  • Ruff
  • Pyright
  • pre-commit
  • uv

Deployment / Runtime

  • Docker
  • Docker Compose

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages