A Python module for votings on the c-base space-station.
test | ||
voting | ||
.gitignore | ||
poetry.lock | ||
pyproject.toml | ||
README.md | ||
TODO.md |
Python-Voting
A Python 3.11 module for votings on the c-base space-station.
Usage
from voting.voting import Quorum, QuorumKind, Vote, Voting, Result
# initializing a new voting
voting = Voting(
title="EXAMPLE",
quorum=Quorum(), # equals Quorum(kind=QuorumKind.NONE, value=None)
#quorum=Quorum(kind=QuorumKind.ABSOLUTE, value=42),
#quorum=Quorum(kind=QuorumKind.PERCENT, value=42.0),
voters=['alice', 'bob'],
)
# placing a vote
voting.vote('alice', Vote.NO)
# overwrite an existing vote
voting.vote('alice', Vote.YES)
# obtaining the result
res = Result(voting)
print(res.result())