📝 Add README
This commit is contained in:
parent
2e195011c0
commit
9bb0d83b02
1 changed files with 31 additions and 0 deletions
31
README.md
Normal file
31
README.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Python-Voting
|
||||
|
||||
A Python 3.11 module for votings on the c-base space-station.
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
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)
|
||||
```
|
Loading…
Reference in a new issue