Merge pull request #142 from grahamwhaley/20200212_election_tools

election: tools: update README
This commit is contained in:
Salvador Fuentes 2020-02-13 09:32:23 -06:00 committed by GitHub
commit c914ab2ddb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,14 @@
# Election Tools # Election Tools
This directory contains the tools required to generate the Kata Containers electorate This directory contains tools that can help generate the Kata Containers eligible
electorate details.
## `generate_electorate.py` ## `generate_electorate.py`
The `generate_electorate.py` tool gathers data from GitHub and generates a `YAML`
dataset containing the details of the eligible electorate for a defined date range.
This tool needs the following python libraries: This tool needs the following python libraries:
* `pytz` * `pytz`
@ -21,11 +25,19 @@ $ .venv/bin/pip install pytz github3.py pyyaml
Before running the tool you will need to create a Before running the tool you will need to create a
[GitHub API token](https://github.blog/2013-05-16-personal-api-tokens/) [GitHub API token](https://github.blog/2013-05-16-personal-api-tokens/)
replace `__API_TOKEN__` with your personal token. replace `__API_TOKEN__` in the script with your personal token.
Also update the election start and end times. Then run the tool with: Also update the election start and end times to cover the period being
examined for this election period. The lines to edit look like:
```python
start_time = datetime.datetime(2018, 1, 1, 0, 0, 0, tzinfo=pytz.UTC)
end_time = datetime.datetime(2018, 8, 1, 0, 0, 0, tzinfo=pytz.UTC)
``` ```
Then run the tool with:
```bash
$ .venv/bin/python ./generate_electorate.py $ .venv/bin/python ./generate_electorate.py
``` ```
@ -44,3 +56,9 @@ The sources for email addresses are:
* Look for a `Signed-Off-By` line in the commit message * Look for a `Signed-Off-By` line in the commit message
The GitHub login is always stored so that is the primary identifier. The GitHub login is always stored so that is the primary identifier.
## Output results
As the script runs it prints a summary on `stdout`. When the script has completed it places the
generated data into a file called `electorate.yaml`. Use this file to send the bulk email notification
to the eligible electorate.