/op-tcg-scraper

One Piece TCG data scraper written in Rust

Primary LanguageRustGNU General Public License v3.0GPL-3.0

πŸ‘’ op-tcg-scraper

One Piece TCG data scraper written in Rust.

Where is the data?

For practical reasons, data is kept in a separate repository: https://github.com/Coko7/op-tcg-data

πŸƒ Supported card fields

#[derive(Debug, Deserialize, Serialize)]
pub struct Card {
    pub id: String,
    pub name: String,
    pub rarity: CardRarity,
    pub category: CardCategory,
    // pub number: i32,
    // #[serde(skip_serializing)]
    // pub set_id: String,
    // pub copyright: String,

    // Images
    pub img_url: String,
    // pub illustration: CardIllustration,
    // pub illustrator_name: String,

    // Gameplay
    pub colors: Vec<CardColor>,
    pub cost: Option<i32>, // Only Character, Event and Stage (called life for Leader)
    pub attributes: Vec<CardAttribute>, // Only Leader and Character
    pub power: Option<i32>, // Only Leader and Character
    pub counter: Option<i32>, // Only Character

    pub types: Vec<String>,
    pub effect: String,
    pub trigger: Option<String>,
    // pub notes: String,
}

Fields have been named following the terms used in the official rule book

πŸ› Issues

When using jp locale to fetch data, the scraper will likely fail when handling counter or colors values for some cards.

πŸ—ΊοΈ Road Map

  • Fetch card sets data
  • Better error handling
  • Fetch cards data for each card set (wip)
  • Get card data for all card sets
  • Organize and save cards data as JSON to files
  • Add logs
  • Support more card fields
  • Download card images as well
  • Make it locale-agnostic to be able to download data from Japanese and other versions
    • Handle problems with the jp version (inconsistent cards data on official site)
  • Better configuration
  • User friendly CLI
  • Add tests