A Python module for votings on the c-base space-station.
Go to file
Brian Wiborg e865b151c1
📝 Add TODO.md
2023-04-02 17:00:14 +02:00
voting ✏️ Fix misleading typo 2023-04-02 16:52:13 +02:00
.gitignore 🎉 Let the voting begin. 2023-04-02 16:41:27 +02:00
poetry.lock 🎉 Let the voting begin. 2023-04-02 16:41:27 +02:00
pyproject.toml 🎉 Let the voting begin. 2023-04-02 16:41:27 +02:00
README.md 📝 Add README 2023-04-02 16:48:27 +02:00
TODO.md 📝 Add TODO.md 2023-04-02 17:00:14 +02:00

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)