GithubHelp home page GithubHelp logo

miguelramosfdz / agora-tally Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sequentech/tally-methods

0.0 2.0 0.0 319 KB

agora-tally

License: GNU Affero General Public License v3.0

Python 96.97% R 2.71% Shell 0.33%

agora-tally's Introduction

agora-tally

agora-tally provides functions for tallying election data using OpenSTV as the underlying library when necessary

Entry functions

The entry point for tally processing is either

  • do_dirtally(dir_path)

Tallies election data found in the given directory

  • do_tartally(tally_path)

Tallies election data found in the given tar.gz file.

Input format

Both the tar and directory functions expect the same file structure for election data:

<root>
|
|- questions_json (file describing the election questions)
|
|--- 0-xxxxx (directory with data for the 0th question)
|    |
|    |
|    --  plaintexts_json (file containing votes, one per line)
...
|
|--- n-xxxxx (directory with data for the nth question)
     |
     |
     --  plaintexts_json (file containing votes, one per line)

result_json format

TODO

Please refer to the test/fixtures directory for samples of election data.

plaintexts_json format

TODO

Please refer to the test/fixtures directory for samples of election data.

Voting methods

The following methods are currently supported:

  • plurality-at-large

Refers to both approval (one winner) and plurality-at-large (list of winners) methods where ballots reflect approval of candidates with no order specified.

Testing

In order to run tests you have to set up a virtual environment in which to install the OpenSTV dependency. The script

test/testing_setup.sh

is provided to do this. When testing you have to activate the environment with

workon agora-tally

Then run the tests with

python -m unittest discover

License

Copyright (C) 2015 Agora Voting SL and/or its subsidiary(-ies). Contact: [email protected]

This file is part of the agora-core-view module of the Agora Voting project.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Commercial License Usage Licensees holding valid commercial Agora Voting project licenses may use this file in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Agora Voting SL. For licensing terms and conditions and further information contact us at [email protected] .

GNU Affero General Public License Usage Alternatively, this file may be used under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation and appearing in the file LICENSE.txt included in the packaging of this file, or alternatively found in http://www.gnu.org/licenses/.

External libraries This program distributes libraries from external sources. If you follow the compilation process you'll download these libraries and their respective licenses, which are compatible with our licensing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.