This is the secondary repository for Bracketcounter - it's basically got everything except the actual data collection (see the main bracketcounter for that).
This is a set of command line tools, you will want to use them in the Windows Command Prompt or PowerShell, or the Terminal on Linux or macOS.
- Install Python 3
- Download these files or clone with Git (like with Bracketcounter itself)
- Run
pip -r requirements.txt
- Copy
config.example.py
toconfig.py
- Delete
savestate.json
and restart your Bracketcounter with a clean savestate (this should get rid of any since deleted comments that would interfere with the data) - After it counts all the comments, stop your Bracketcounter instance (in the typical use case, just press Ctrl+C.)
- Copy
savestate.json
from the Bracketcounter folder to thesavestate
folder, and rename it to something sensible, likesavestate-ep1.json
. - Edit
config.py
to add details for the episode you are counting - these should mostly mirror configuration on Bracketcounter's server end. The example comes with enough annotation so it should be easy to follow. - Run
python processor.py
. You only need to do this once per episode, and once it's done you can delete the savestate if you want. This script takes the savestate data and minifies it into only the user, vote, and time. It also does "hashing" on the user IDs: basically this means that you can check that vote A and vote B were both done by the same person for switching purposes, but you can't easily reverse the hash to find out who that person was.
After you've processed data for an episode, you will want to use the main data scripts (python scriptname
), described below:
data.py
- This is the main script that you probably will only ever use, it produces the votes over time per character graph, the votes per minute graph, and the main voting results numbers (in a Discord postable format, but you can use them for anything)data-alleps.py
- This script creates a graph of the voters over time per episode (all characters)sankey.py
- This creates data for a voter switching graph; you need to put the output into SankeyMATIC or a compatible tool.allvoters.py
- This calclates the total number of all voters, or all voters who have voted on every episode, and outputs it tovlist.msgp
, for use insankey.py
so you can chain the graphs together and produce a more interesting result. Also, it creates the "voter newness" graph, which shows for each episode how many episodes each voter has voted on.datatool.py
just runsdata.py
for all episodes.
- The
graph
andgraph2
folders andgraph-totals.html
are HTML conversions of the graphs you see, designed to be uploaded to a website to view (mainly for my application, you probably won't need these) dataFilename
can be set as either a file ending inmsgp
orjson
. Themsgp
format is msgpack, which is much faster to encode and decode, and smaller in filesize, so it is recommended in most applications. You may find thejson
format more useful if you want to take the data and use it in other applications outside of these data tools. You can usejson2msgp.py
to convert.