This is the code I am using to generate the examples for a small book I'm writing. It's for producing various small elections that illustrate differences between voting systems.
It is super shonky right now and probably won't make much sense, but I'm making it available early for the purpose of reproducibility. I'll tidy it up to make more sense later, honest.