A simple desktop application built with PyQt5 to help Magic: The Gathering players find budget-friendly Commander/EDH decklists.
This tool automates the process of finding a commander, looking up budget decks on EDHRec, and exporting a text-based list for use in online simulators or deckbuilding tools.
- Commander Search: Find any legal commander using the full Scryfall Search Syntax.
- Image Display: Fetches and displays the commander's card image.
- Budget Filtering: Finds decklists on EDHRec and filters them based on a user-defined maximum price.
- Automated Scraping: Uses Selenium with
selenium-stealth
to reliably scrape decklists from popular hosting sites like Moxfield and Archidekt, bypassing bot detection. - Direct-to-Clipboard: Copies the final, formatted decklist directly to your clipboard.
- Search: You enter a commander's name. The app queries the Scryfall API to find the card and its EDHRec page.
- Fetch Decks: It navigates to the commander's EDHRec page and parses the embedded JSON data to find recent decklists.
- Filter: It filters the found decks by the budget you specified.
- Scrape: It takes the link to the first matching deck (e.g., on Moxfield or Archidekt) and launches a background Selenium process.
selenium-stealth
is used to avoid being blocked by services like Cloudflare. - Extract: The background worker either parses the embedded page data (for Archidekt) or simulates clicks (for Moxfield) to get to the text export.
- Copy: The final decklist is sent back to the main application and copied to your clipboard.
This project requires Python 3 and a working installation of Google Chrome.
-
Clone the repository:
git clone <your-repository-url> cd <your-repository-directory>
-
Create a virtual environment (recommended):
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install the required packages: Create a
requirements.txt
file with the following content:PyQt5 requests beautifulsoup4 selenium selenium-stealth pyperclip
Then, install them:
pip install -r requirements.txt
-
Run the application:
python qtcommanderfinder.py
This tool relies on web scraping from third-party websites (Scryfall, EDHRec, Moxfield, Archidekt). The structure of these websites may change at any time, which could cause the scraping logic to fail. If you encounter issues, the selectors in the DecklistScraperWorker
class may need to be updated.
This tool is intended for personal, educational use. It is designed to make a limited number of targeted requests and not to overload the servers of the websites it interacts with.
- It uses a realistic
User-Agent
header. - It does not perform rapid, repeated requests.
- It respects the data structures provided by the sites (e.g.,
__NEXT_DATA__
) where possible, as this is more efficient and less intrusive than UI interaction.
Please use this tool responsibly.
Window icon found at Flaticon and was created by manshagraphics