Shadowverse Classify

A script that analyzes JCG data and classifies archetypes played by players.

1. Providing sample decks

In order for this script to work well, you need sample decks to analyze archetypes.
You can use the following code to generate samples inside the samples folder
python jcg_lists.py -c jcg-code where jcg-code is the code for the jcg tournament you want to use as sample.

This will generate new files inside the samples folder with the following format craft-n.csv
Those files can be used in the other script, cluster.py to identify archetypes.

2. Archetype Clustering

cluster.py requires you to input the name of the output json file, which is usually the
format name. For example, python cluster.py -f celestial-dragonblade.json

While running this script, you will be provided with sample decks for each archetype detected
by the algorithm. You will then input the archetype name as follows:

Naming archetype example

And you should pick the proper name for the archetype given the deck list.

After you go through the process, you will find a new json file created that looks similar to this: json output

This file will be used by the analyzer to determine the card archetypes.

3. JCG Analysis

After running all the scripts, you will then be able to run the analyzer.py script as follows: python.py analyzer.py -c jcg-code -f format-file where format-file is the file generated by cluster.py

The end result will bring 4 files:

  • <jcg-date>-lineups.csv: Contains info about player names and lineups used.
  • <jcg-date>-archetypes.csv: Contains info on archetypes used and their numbers
  • <jcg-date>-crafts.csv: Contains infor about the crafts used by players.
  • <jcg-date>-classified-decks: Contains a list of each deck link along with its archetype name.

4. Example of analysis output:

This is an example of the resulting <jcg-date>-lineups.csv file ran for the JCG on 25th of September.

Lineups example

5. Credits

This work was inspired by Zhiff's repository, which is used to make user-friendly .xlsx files of the JCG analysis.
Also, thanks to Finalysis for the information on how to generate the database, which I copied and used in my files.

6. Conclusion

If you have any suggestions on this project, please let me know. I will be happy to accept
any pull requests that improves this script's performance, or makes it more user-friendly.

Currently, I do not plan on making a GUI for this project, because it will be mainly used
with another project to feed data into the database.