Closed LoganDungeon closed 2 years ago
i have a simple doc for CSVwhen you click on '?' in adminPanel coul'd you send me your log file ?
Did you tried DelverLens import plugin ?
I did try the DelverLens import tool and the 'normal' csv import tool. Neither seem to do the job. The log just reports no match found for any format i try.
For the delver lens tool it seems that you use regex to validate the input. I don't think this works well, since in the app, you can chose which fields to export, so in order for the regex to work, one would have to chose the exact needed fields in the exact sequence.
And for the normal csv format it seems, that as soon as some fields are missing, the import just fails.
I feel like the only fields that should be "required" are name, quantity, edition and maybe Card Number to differentiate special Editions. For everything else, you could just assume a default value, eg. for foil assume not foil if missing, for condition assume MINT, unless specified otherwise.
Maybe i am completely wrong assuming this. But as it stands now, i am quite confused on how to format my card list, so that they all import properly into the companion.
can you send me your import files ? or just a sample
Of course Here a Delver Lens example:
Name,Edition,Collector's number,Foil,Quantity
"Rakshasa's Secret","Khans of Tarkir","84","","2"
"Zombie Infestation","Premium Deck Series: Graveborn","19","Foil","1"
and a csv example with the needed fields:
Card Name;Edition;Language;Qte;Condition;Foil;Altered;Signed;Collection;Price;Comment
Bind the Monster;Kaldheim;English;1;MINT;true;false;false;Library;0.0;null;
Birgi, God of Storytelling;Kaldheim;English;1;MINT;false;false;false;Library;0.0;null;
your delver lens format is simple format. I developped plugin for "Count,Tradelist Count,Name,Edition,Card Number,Condition,Language,Foil,Signed,Artist Proof,Altered Art,Misprint,Promo,Textless,My Price"
i need to update this plugin for multiple formats.
for your CSV export you missed on column . and i see i forgot to catch names with comma. I'll fixed in next release. be carreful, by default, separator is semicolon
I managed to write a program that converts exports from Delver Lens to a format that can be imported into the MTG companion.
nice, do you wan't to share it ? i can adapte it to be integrated in mtgcompanion Delver plugin
So this python script converts a specific format of delver lens files to a single collection '.csv' file for the companion.
It expects any number of files in a folder called 'collection' in the same directory as the script.
It depends only on the 'pandas' libraray for dataframe manipulation.
The format for the input files should be:
Quantity, <Blank>, Name, Edition, Collector's number, Condition, Language, Foil, <Blank>, <Blank>, <Blank>, <Blank>, <Blank>, <Blank>, <Blank>
The the script will convert it to the following format:
Count,Tradelist Count,Name,Edition,Card Number,Condition,Language,Foil,Signed,Artist Proof,Altered Art,Misprint,Promo,Textless,My Price
The script does the following notable things:
foil
collumn to lower caseTradelist Count
equal to Count
(Have not used tradelist yet, maybe this should be zero)I don't know exactly how your plugin works, but this should probably be rewritten in java with something like tablesaw As my experience with java is limited to the bit we did in university a few years back and i have not worked with big projects yet, i don't think i can be a big help in this part. But maybe this is enough for you to know how to integrate this or something similar.
import pandas as pd
import os
import csv
# Format of the input files:
# Quantity, <Blank>, Name, Edition, Collector's number, Condition, Language, Foil, <Blank>, <Blank>, <Blank>, <Blank>, <Blank>, <Blank>, <Blank>
# Output format:
# Count,Tradelist Count,Name,Edition,Card Number,Condition,Language,Foil,Signed,Artist Proof,Altered Art,Misprint,Promo,Textless,My Price
folder = "./collection/"
files = os.listdir(folder)
data_list = []
for f in files:
data_list.append(pd.read_csv(folder + f))
collection_data = pd.concat(data_list)
collection_data["Foil"] = collection_data["Foil"].str.lower()
collection_data.rename(columns = {
'Quantity': 'Count',
'<Blank>':'Tradelist Count',
'Collector\'s number': 'Card Number',
'<Blank>.1':'Signed',
'<Blank>.2':'Artist Proof',
'<Blank>.3':'Altered Art',
'<Blank>.4':'Misprint',
'<Blank>.5':'Promo',
'<Blank>.6':'Textless',
'<Blank>.7':'My Price',
}, inplace = True)
collection_data["Tradelist Count"] = collection_data["Count"]
collection_data["Collection"] = "Library"
collection_data.to_csv("collection.csv", sep=',', index=False, quoting=csv.QUOTE_ALL)
You should add documentation on what fields are needed for csv imports and how they should be formated.
When i try to import files from Delver Lens,
nothing happensWindows gives 'Import finished' notification, but no cards show up; no error. Even when trying to import the in #75 mentioned 'export.txt' nothing happens.Am i missing something with importing cards into the program or is this an area, where the companion still needs some work?