Skip to content

Kooolpool/ydk_converter_web

Repository files navigation

Yu-Gi-Oh! Deck Converter

A web application that converts Yu-Gi-Oh! deck files (.ydk) into a human-readable format. The application supports proper card counting, maintains card order by section (Main/Extra/Side deck), and provides easy-to-read output with download functionality.

Features

  • 📤 Drag-and-drop YDK file upload
  • 🃏 Accurate card name resolution using local database and YGOProDeck API
  • 📊 Proper handling of duplicate cards with counts (e.g., "Dark Magician x3")
  • 📝 Clean, organized output separated by deck sections
  • ⬇️ Download results as text file
  • 🎴 Offline-first with local card database
  • 🔄 Automatic API fallback for new/unknown cards

Technologies Used

  • Python 3.x
  • Flask (Web Framework)
  • Bootstrap 5 (Frontend)
  • YGOProDeck API (Card Resolution)

Installation (for local use)

  1. Clone the repository:
git clone https://github.com/yourusername/yuhioh_web.git
cd yuhioh_web
  1. Create and activate a virtual environment:
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/MacOS
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Get all new card info from the api:
python fetch_card_info_json.py           
  1. Run the application:
python app.py   

The application will be available at http://localhost:5000

Usage

  1. Open your web browser and navigate to http://localhost:5000 after installing or go to https://ydk-converter-web.onrender.com/
  2. Drag and drop your .ydk file onto the upload area (or click to select)
  3. The application will convert your deck file and display the results
  4. Click the "Download as TXT" button to save the converted deck list

Project Structure

yugioh-deck-converter/
├── app.py              # Main Flask application
├── cardinfo.json      # Local card database
├── requirements.txt   # Python dependencies
├── downloads/        # Temporary download storage
├── logs/            # Application logs
└── templates/       # HTML templates
    ├── index.html   # Upload page
    └── result.html  # Results display page

Features in Detail

Card Database

  • Uses a local JSON database for quick card lookups
  • Automatically falls back to YGOProDeck API for unknown cards
  • Caches new card information during runtime

Deck Processing

  • Maintains original deck structure (Main/Extra/Side)
  • Properly handles card duplicates with count indicators
  • Alphabetically sorts cards within each section
  • Preserves card counts accurately

User Interface

  • Modern, responsive design using Bootstrap 5
  • Drag-and-drop file upload support
  • Error handling with user-friendly messages
  • Clean, organized results display
  • One-click download of converted deck lists

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Contact

If you have any questions or suggestions, please open an issue in the repository.