<div dir="ltr"><div>I'm still sorting through this.  Rather than give up on my parsing script, I decided to use it to create a parsing tool for parsing the <a href="http://sfgov.org">sfgov.org</a> published results, which I just published as a standalone script (sfballotparse.py):</div><a href="https://gist.github.com/robla/7664d03372e6a80f1372869c09472b60">https://gist.github.com/robla/7664d03372e6a80f1372869c09472b60</a><br><div><br></div><div>Now to nerd out just a little bit: Brian Olson's output format that he uses (one urlencoded line per ballot-contest) can be condensed into a vaguely readable form if piped through "sort | uniq -c".  Which I did, then published here:</div><div><a href="https://gist.github.com/robla/b9e8df41d94a62d4190760eac044b3bc">https://gist.github.com/robla/b9e8df41d94a62d4190760eac044b3bc</a></div><div><br></div><div>I'm planning on using that as a means of manually checking the results when I ran Brian's tool to get the pairwise count from the election.</div><div><br></div><div>I've tested my tool to create input for Brian's voteutil/python/countvotes.py script.  The results were very close, but not identical; I haven't yet figured out if it's a bug in my code, or a bug in his code, or sunspots, or what.</div><div><br></div><div>Rob</div><div>p.s. Brian, I would love it if you had the time to give my script a whirl, but no worries if you don't.  I'll eventually get around to filing a bug/submitting-a-patch/whatever-is-appropriate<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 15, 2018 at 11:08 PM, Rob Lanphier <span dir="ltr"><<a href="mailto:robla@robla.net" target="_blank">robla@robla.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-">On Mon, Jun 11, 2018 at 10:16 AM, Brian Olson <span dir="ltr"><<a href="mailto:bql@bolson.org" target="_blank">bql@bolson.org</a>></span> wrote:<br></span><div><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:"times new roman",serif">I wrote Python code to parse the 'ballot image' and 'master lookup' files.</div><div><font face="times new roman, serif"><a href="https://github.com/brianolson/voteutil/blob/master/python/rcvToNameEq.py" target="_blank">https://github.com/brianolson/<wbr>voteutil/blob/master/python/rc<wbr>vToNameEq.py</a></font><br></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">I have this exporting to www-cgi formatting like</font></div><div class="gmail_extra"><font face="times new roman, serif">Alice=1&Bob=2&Carol=3</font><br></div></div></blockquote><div><br></div><div><br></div></span><div><div>Cool, you're obviously a lot further along than I am.  I've got my own (as yet unpublished) script for parsing out the ballot image files, but I don't have my script doing any tallying yet.</div><div><br></div><div>I downloaded your voteutil code, ran rcvToNameEq against SF's report14 results, and then tried running that through countvotes.py, getting it to cough up a matrix.  I don't want to say yet who my output shows as having won a particular pairwise contest after parsing report14 (124004 to 105292), but it's kinda interesting (and probably a sign I need to debug something rather than finding something truly interesting).<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>Rob<br></div><div><div class="gmail_extra"><br></div></div></font></span></div><br></div></div></div></div>
</blockquote></div><br></div></div>