Topic: Python script to compare inventories

Hi everyone. I hope this is allowed but if not then I apologise and would ask a mod to remove my post.

I don't know how common this is but my friends and I try to open boosters and swap cards in order to own at least 1 of every card in each set as they get released. One thing we sometimes have trouble with is working out which cards we have duplicates of but are needed by our other friends. Currently we have to sit there with our piles of duplicates and physically go through them one card at a time to work this out, especially with newer sets that we don't know very well yet.

We all use deckbox for our inventory management (because it's easily the best site out there for this!) and so I wrote a short python script that will compare two exported Deckbox inventory .csv files to each other and output two more .csv files that lists possible trades.

Basically it says "Do I have a duplicate of this card? If yes, does my friend have 0 copies of this card? If yes to that as well, add it to the list of possible swaps". It then does the same thing the other way around and gives a second list of the cards your friend could trade to you.

Is this something that the community here would find useful? Is it worth me refining it a bit and putting it up for general use or are we abnormal in how we go about our collecting cards?

Thanks!

Hamish

Re: Python script to compare inventories

this seems like something that could be accomplished with a couple exports and a simply spreadsheet with some vlookups.  or dump everything into access then just do some queries/reports.

Re: Python script to compare inventories

Yep, pretty much but it was fun to set myself a challenge and write it¡ smile

Re: Python script to compare inventories

I would be much more interested in a Python script that looked at EDHRec's recommended cardlist for a general and combined it with Deckbox's knowledge of what cards I already own. This would tell me what cards I own but haven't thought of would be good possible additions to a deck.

Re: Python script to compare inventories

Break3r - I like that idea too....  I'll take a look and see what is feasible with my limited scripting knowledge!

EDIT: So I have put something together (was easier than I first thought). It takes one Deckbox inventory export (.csv) and one commander name (from EDHREC) and then the output is a list of cards you own that feature on the page of the commander on EDHREC.

Is this the kind of thing you had in mind?

Last edited by Hamish (2017-08-14 16:49:32)

Re: Python script to compare inventories

Hamish wrote:

Break3r - I like that idea too....  I'll take a look and see what is feasible with my limited scripting knowledge!

EDIT: So I have put something together (was easier than I first thought). It takes one Deckbox inventory export (.csv) and one commander name (from EDHREC) and then the output is a list of cards you own that feature on the page of the commander on EDHREC.

Is this the kind of thing you had in mind?

That's pretty much exactly what I had in mind. A nifty feature would be including the price of the cards being recommended wink

Can you share it, or is it on Github?

Re: Python script to compare inventories

Hamish wrote:

Break3r - I like that idea too....  I'll take a look and see what is feasible with my limited scripting knowledge!

EDIT: So I have put something together (was easier than I first thought). It takes one Deckbox inventory export (.csv) and one commander name (from EDHREC) and then the output is a list of cards you own that feature on the page of the commander on EDHREC.

Is this the kind of thing you had in mind?

I actually think I'll be able to figure it out on my own, but let me know if you want to compare notes big_smile