Skip to content

sortitionfoundation/stratification-app

Repository files navigation

Strat App

Test Status

A simple GUI for stratification for sortition/citizens' assemblies.

About

Random stratified selection software.

The algorithms are described in this paper (open access).

Other relevant papers:

Development

The app is built using eel - a framework that allows the GUI to be defined in HTML and CSS, but then some basic JavaScript can call Python and I can do the heavy lifting in Python.

Install for development

First you need to have the following installed:

Running in development

When you first set up a development version, you need to clone this repo, open a terminal in the root of the repo and run:

uv run python script.py

At this point you should have a window pop up and be able to interact with it, either via uploading .csv files or else by reading directly from a google sheet.

As you update the repo or want to re-run, the above command is all you need.

Key files

The python command python script.py requires only:

  • script.py
  • stratification.py
  • all of the files in the folder web

To use uv (as we suggest above) to control dependencies, you need pyproject.toml

To create exectuables using pyinstaller (as we describe below), you need hook-mip.py to deal with this error.

Executables

You can download executables from the latest releases page. These are built by GitHub Actions.

Manual builds

If you want to make an executable yourself, use PyInstaller. The following set of commands, run in the root of the repo, create a single file executable in the folder dist.

git pull
uv run python -m eel script.py web --additional-hooks-dir=. --onefile --noconsole

The resulting executable will work on any computer running the same operating system as yours, i.e. Windows, Mac OS or Linux. So if you run the above command on Linux, you can give the file to someone else running Linux. If the person who wants the app is running Windows, you need to run the above command on Windows.

About

A simple GUI for stratification when selecting a citizens' assembly.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5