Skip to content

abishop1990/tft-analyzer

Repository files navigation

TFT "Moneyball" Assistant

A Python-based Teamfight Tactics (TFT) assistant that recommends team compositions based on "Expected Value" (EV) rather than just meta popularity.

This tool helps you make smarter decisions by showing you the real-time probability of finding key champions based on which units are already taken from the shared pool.

Features

  • Live Shop Odds: Calculates the probability of finding specific 4 and 5-cost champions in your next shop, based on your level.
  • Strategy Engine: Automatically classifies champions into roles (Tank, Caster, Fighter) and damage types (Magic, Attack) to analyze team balance.
  • Manual Contention Tracking: A simple UI to track how many copies of key units have been taken by your opponents.
  • Data-Driven Suggestions: Highlights the most "open" (uncontested) units, allowing you to pivot into less contested lines.
  • Dynamic Data Pipeline: Automatically pulls the latest champion, item, and trait data from CommunityDragon and splits it for optimized loading.
  • Game State Management: Reset your game state instantly to start a new match.

How to Run

  1. Install Dependencies: Make sure you have Python 3.11+ installed. Then, install the required packages using pip:

    pip install -r requirements.txt
  2. Download Game Data: Before the first run, you need to download the latest TFT game data. Run the data loader script from the root directory:

    python data_loader.py

    This will create champions.json, items.json, and traits.json in the data/ directory.

  3. Run the Streamlit App: Once the data is downloaded, you can start the web application:

    streamlit run app.py

    This will open a new tab in your browser with the TFT Assistant.

Project Structure

tft-analyzer/
│
├── data/
│   ├── champions.json      # Parsed champion data
│   ├── items.json          # Parsed item data
│   ├── traits.json         # Parsed trait data
│
├── app.py                  # The main Streamlit application
├── data_loader.py          # Handles downloading, parsing, and splitting game data
├── strategy.py             # Logic for champion roles, damage types, and team analysis
├── probability.py          # The core probability calculation engine
├── recommender.py          # Placeholder for future EV comp recommendations
│
├── tests/
│   ├── __init__.py
│   └── test_probability.py # Unit tests for the probability engine
│
├── README.md               # This file
└── requirements.txt        # Python package dependencies

About

Live analytics for playing your best game of Teamfight Tactics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors