yeva

package module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

README

Yeva

Introduction

This is a project to integrate and query various online resources regarding Magic the Gathering cards (a popular trading card game). If you're unfamiliar with Magic, I tried to put together a quick over view of what I'm doing at the bottom of this Readme.

Go get

go get github.com/BennettMobley/yeva

Config Example

Yeva:
  SaveImagesToPath: "../img/"
  InventoryNumber: "1888048"
  Decklists:
    - "2831542"
    - "2822543"
    - "2796083"
    - "2818346"

"I Just Want To See Code Run"

git clone https://github.com/BennettMobley/yeva.git 
mkdir ./img
cd ./yeva
# The following command isn't really a test
# It downloads the images from my favorite decks
go test .yeva_test.go # This will take a while as it downloads ~320 images
Magic the Gathering
  • Scryfall.com (API Docs) - The search engine for Magic cards. Also provides a robust API. (Per their API Docs, the Scryfall team asks the public to include a 100ms wait time between each request.)
  • Deckbox.org - One of the more pupular free inventory management sites.
Technology
  • Go Test Coverage - Native analysis of it, Really neat!
  • Deckbox Set to Scryfall Set - Due to differences in data, the MTG set names between the two platforms are different. I've made a seperate project to compile the majority of those differences dynamically.

Overview

TL;DR
  • MtG is a TCG with a long history
  • I wanted to download images of my favorite decks
What's Magic the Gathering?

Magic the Gathering is a 25+ year old trading card game (literal pieces of cardboard). Because of its long history there are thousands of cards.

Because of the vast quantity there exists many search engines that can query cards based on a multitude of factors. The most unique ways to identify a card is:

  • Name - Quite literally the name of the card in the top most area. (Above it would be "Yeva, Nature's Herald")
  • Set - The cards that were printed along with the given card. Typically found in the lower left hand corner. (DDU)
  • Collector Number - The card's number within a given set. Again, typically found in the lower left hand corner. (27)

There's certianly plenty of corner cases for special printings of cards, but for the vast majority of Magic the Gathering cards, these 3 values are unique idnetifiers of cards.

When a player might look up a particular card they might find that a card has had several printings (i.e. reprints). This is why that Set and a Collector Number are necessary to uniquely identify Name of a card.

In Magic, you can create collection of cards to play against other people. These collections are called Decks (typically 60-100 cards make up a deck). Usually a player's entire collection of cards are called their inventory.

Players tend to play different formats of Magic. A format is a particular rules, ban list of cards, etc. that people have agreed to adhere to.

So, finally getting to this project, I have a favorite deck. I wanted to go about downloading an image of each card in that deck for the particular set I own of each (where applicable). I of course didn't want to manually download each image. Rather, I wanted a way to automate pulling the images from Scryfall based on my decklists that I keep in Deckbox.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadImages

func DownloadImages()

DownloadImages gets images of the specific inventory and decks

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL