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