Python: Filtering lists for value

Update: The way I was pulling price data (the Deckbrew API) has changed the format for data coming back, and I haven't updated my code, so the tool no longer functions. If you're looking for a intuitively laid out mtg price listing by set, I highly recommend the visualizers and listings over at mtg.dawnglare.com!

I've worked with Python for years now, but had never really pursued the idea of running it server-side to generate dynamic content. I came across a problem that was suited for it recently. I had a box of ~5000 Magic: The Gathering commons and uncommons from older sets, and I didn't have a good idea of which were worth something compared to the rest of the chaff. I found the Deckbrew API, and was able to make calls to that by grabbing a well-shaped URL. It was a short path to putting together a simple HTML form for specifying the filter and threshold values as well as displaying the results.

The resulting tool can be found here!

There are certainly bugs, primarily that I've already encountered cards that are listed, but have no listed price for the printing of interest. I'm thinking to work around this by picking the value of an alternate printing, but haven't bothered to work that out yet.

Leave a Reply