It is recommended to use a Virtual Environment using the following command:
python -m venv .
All required Python dependencies can be installed using:
python -m pip install -r requirements.txt
src/python/bp/data contains data collection logic to scrape training data in the form of past ballots from www.bk.admin.ch. This data is persisted in src/python/bp/resources to avoid repeated downloads.
When the project is first configured, or when the data should be updated with the most recent data from www.bk.admin.ch, the following command can be used:
cd src/python
python -m bp.data.collector
To run the python tests, use:
python -m unittest discover -s src/python
To run the python tests with coverage information, use:
python -m coverage run --source src/python -m unittest discover -s src/python; python -m coverage report --fail-under 100 --show-missing
Start the web application in dev mode:
npm --prefix src/js run dev
Create static webapp for deployment:
npm --prefix src/js run build