Skip to main content

A conversational CLI copilot for Fantasy Premier League, powered by Claude

Project description

FPL Copilot

A conversational CLI copilot for Fantasy Premier League. Chat with Claude to analyze your team, scout players, check fixtures, and execute transfers — all from your terminal.

Think of it like Claude Code, but for FPL.

Prerequisites

  • Python 3.11+
  • An Anthropic API key
  • Your FPL team ID (find it in the URL when viewing your team on the FPL website)
  • (Optional) FPL login credentials for executing transfers
  • (Optional) Firecrawl API key for enhanced player news

Installation

git clone git@github.com:amit3992/fpl-copilot.git
cd fpl-copilot
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install chromium

Copy .env.example to .env and fill in your keys:

cp .env.example .env

Usage

python cli.py

What you can ask

  • "Show me my team" — view your full squad with form, price, and status
  • "How's my budget looking?" — bank balance, free transfers, available chips
  • "Any injury news?" — check which of your players are flagged
  • "Tell me about Palmer" — detailed stats, recent form, upcoming fixtures
  • "Who should I replace Salah with?" — top 5 ranked alternatives within budget
  • "Is it worth taking a hit to bring in Haaland for Watkins?" — projected net gain analysis
  • "What are Arsenal's next 5 fixtures?" — fixture difficulty ratings
  • "Transfer out Salah, bring in Palmer" — stages the transfer for your approval
  • "Show my transfer history" — past transfers from previous sessions

Commands

Command Description
/quit Exit the CLI
/clear Clear conversation history
/history Show conversation history
/debug Toggle verbose tool call logging

Environment Variables

Variable Required Description
ANTHROPIC_API_KEY Yes Your Anthropic API key
FPL_TEAM_ID Yes Your FPL team ID
FPL_EMAIL No FPL login email (needed for transfers)
FPL_PASSWORD No FPL login password (needed for transfers)
FIRECRAWL_API_KEY No Firecrawl API key for enhanced news scraping

Architecture

cli.py              → Chat loop (Rich UI + Anthropic API)
core/fpl.py         → Async FPL API wrapper (aiohttp)
core/scoring.py     → Player scoring and ranking logic
tools/team.py       → Team, budget, and player stat tools
tools/news.py       → Injury news and player availability
tools/analysis.py   → Transfer recommendations and fixture analysis
tools/browser.py    → Playwright-based login and transfer execution
tools/registry.py   → Anthropic tool definitions and handler mapping
db/schema.sql       → SQLite schema for session state and transfer history

Claude handles all orchestration — no LangGraph or agent frameworks. The CLI sends your message plus the tool definitions to Claude, which decides what to call based on your question. Transfers require explicit y confirmation before executing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fpl_copilot-0.1.3.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fpl_copilot-0.1.3-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file fpl_copilot-0.1.3.tar.gz.

File metadata

  • Download URL: fpl_copilot-0.1.3.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fpl_copilot-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ed7c7478f0d15ffdc0b7ea353fba2adc9cbc6a59d1ee0b989458bd4fb00e46a8
MD5 a4191ff615f8309b7f5b5fa62cc4d369
BLAKE2b-256 c0318c85ab1a978d65d04ea88d28a3908b2ea8360e428faa87606c5767362aa9

See more details on using hashes here.

File details

Details for the file fpl_copilot-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fpl_copilot-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fpl_copilot-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6347ae69e39fded210f684c7851ccc44a75c767e7e1ebd0855514fe0f051593a
MD5 1d9e0e4848456d5282b84556b33e9a8d
BLAKE2b-256 4ffbf1253a7216645557d6f6d9e8581e6227742a002b8935518bb3bd472918b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page