/dragonshield-cardsphere

Python script to convert csv file from Dragon Shield CSV exporter to Cardsphere's format for importing collections

Primary LanguagePython

Dragonshield logo Cardsphere logo

Dragon Shield MTG Card Manager Export => Cardsphere Collection Import


A scripting tool created to import card collections from Dragon Shield Card Manager to Cardsphere's "Haves"

Table of Contents

This Project

I really like Dragon Shield's Card Manager and scanner. The insights provided by Dragon Shield are super helpful as well. If you are not familiar with the Dragon Shield App, check out Dragon Shield Scanner.

I also have been a huge fan of Cardsphere once I've discovered it. I don't get the chance to go to my LGS and trade frequently, and sometimes we just end up with cards that we really have a hard time trading away. Cardsphere is a web platform that allows users to post their collection for trade while also allowing me to create a wants list to receive cards from other users. Check out Cardsphere.

Recently, I revamped a lot of my decks, created several new decks, and totally disrupted my collection on Cardsphere. So I now have to start over. I used Dragon Shield to scan my binders, but I found that Cardsphere didn't like the CSV format that Dragon Shield exported. With the help of the Cardsphere devs and community, and a useful API tool at Multiverse Bridge, I was able to convert Dragon Shield's export CSV files to a format that Cardsphere liked.


Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

You'll need to do a little setup in order to get this project running for the first time. I hope to have executable files in a future update, but I'm not there yet and I want to get this out for people to use.

You'll need Python 3: Click here and download the latest version for your OS. Once downloaded, double-click the installation package.

For Windows:

A window will pop up asking to install Python 3. Make sure you click []Add Python 3.x to PATH, or else you will not be able to run the script.

Once installation is done, open command prompt by typing ctrl + R and type cmd.

You'll need to add a Python Library for making requests to the API. To add the library, type:

python -m pip install requests

This will install the required library so that the converter tool will work.


For MacOS

A window will pop up and walk you through the installation of Python. Once installation is complete, Finder will pop up within the Python 3.x folder. If it doesn't you can simply navigate to your Python 3 folder within the Applications Folder. Here, you will find a fill that will set Python to your PATH. Double-click the file labeled Update Shell Profile.command. A Command Shell will pop up and run the script, setting Python to your PATH.

Once installation is complete, you'll need to add a Python Library for making requests to the API. To add the Library, open a terminal session and type:

pip install requests

This will install the required library so that the converter tool will work.


Installing

  • Navigate to the github repository for this project (if you're not already here).
  • Click the dropdown under Code.
  • Select Download ZIP from the options (see image, instructions continue after image):

  • Extract the zip file to a location you'll remember.
  • Navigate to your collection in Dragon Shield Web Portal. Make sure you're logged in.
  • In the folders tab, you'll see a list of your folder collection. Click the download icon to the right of the folder you'd like to download or the Export button at the top of the list. Your .csv file will be saved in your Downloads folder.
  • Important! Do not edit your .csv file. The output from Dragon Shield is very specific, and many csv readers will create their own formating on save as there is no universal format rules for csv files.
  • Move the csv file (or files...the tool can process many csv files at once) into the dragonshield-cardsphere-main (not the app folder or import-to-cardsphere folder within that folder)

You are now ready to run the converter.

For Windows

  • In the dragonshield-cardsphere-main folder, right click on the file labeled win_ds-cs or win_ds-cs.ps1 (if your file manager is showing file extensions).
  • Select Run With PowerShell from the dropdown options.
  • A PowerShell window will pop up and begin running the converter. When completed, you will find the Cardsphere .csv files in the import-to-cardsphere folder. If this is the case, go to this step...otherwise, continue reading.

If you get a message like this:

.\win_ds-cs.ps1 : File C:\dragonshield-cardsphere-main\win_ds-cs.ps1 cannot be loaded 
because running scripts is disabled on this system. For more information, see 
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\win_ds-cs.ps1
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

...you have two options. Option one is to change the execution policy on your computer or run the command in a command shell.

To change the execution policy, hit the windows key and type PowerShell. Select Run as Administrator. Type this command in the prompt:

Set-ExecutionPolicy -ExectutionPolicy RemoteSigned -Scope LocalMachine

Run the script again and it should work.

The other option is to hit ctrl+r and type cmd. This will open a command prompt. Navigate to the extracted folder dragonshield-cardsphere-main and type the command ./win_ds-cs.ps1. This should work as well.


For MacOS

  • Find the extracted folder dragonshield-cardsphere-main (if you extracted directly in your downloads folder, that's where it will be).
  • Right-click* the folder and select New Terminal at Folder.
    *(I'm a lifelong Windows user who sets my Mac up in a similar fashion with a gaming style mouse, so don't judge for the poor Mac terminology)
  • In the terminal, type ./mac_ds-cs.sh
  • Once the process is completed, you'll find the .csv files in the import-to-cardsphere folder.

Importing to Cardsphere

  • Navigate to Cardsphere's Haves page.
  • Select the Actions tab.
  • Select the Import button to open the Import modal.
  • Select the .csv file you created and Import!
  • I am currently aware that many split cards are not able to be loaded through the import feature and will have to be added manually. This is especially true for Strixhaven, newest Innistrad block, and Neon Dynasty. It's an issue with Cardsphere and they are aware of it.

Enjoy! Please feel free to post comments and reach out with bug reports. I'll do my best to remedy those situations as I can! Thank you for using this tool!

Built Using

Author

Acknowledgements

  • @gunhoe86 - Discord User and Contributor to Multiverse Bridge...reached out with the API information I needed for my project
  • @Bodey & @Michael ʕ •ᴥ•ʔ on the Cardsphere Discord channel who helped with some of the Cardsphere functionality under the hood