A simple program for pairing people together, ensuring that participants:
- will not be paired with people in their own team
- will not be paired with the same people from previous iterations
This app was created to support Randomized Coffee Trials at the Strategy Unit and the NHS RAP Code Review Buddies Network.
- Clone a copy of the repository to your local machine.
- Create a
datafolder. Put yourparticipants.csvin the data folder. Yourparticipants.csvshould have the columnsname,team,email, andactive. Theactivecolumn is Boolean (TRUE/FALSE). A sampleparticipants.csvis provided with dummy data. - Create a
pairingssubfolder and store any previous pairings, if any, there. A sample is provided with dummy data.
Your repository structure should look like the below:
.
├── data/
│ ├── pairings/
│ │ ├── round_1.csv
│ │ └── round_2.csv
│ └── participants.csv
├── src/
│ └── people_pairer/
│ ├── main.py
│ └── ...
├── README.md
├── pyproject.toml
└── ...This package is built using uv. If you have uv installed:
- Create a new virtual environment with
uv venv - Install the package locally with
uv pip install . - Activate the virtual environment with
.venv\Scripts\activateon Windows, orsource .venv/bin/activateon macOS and Linux - Run people pairer with
uv run -m people_pairer.main.
- Install the package locally with
pip install . - Run people pairer with
python -m people_pairer.main.
There are optional arguments:
--data_filepathif your data is stored an a folder other thandata--past_pairingsfor the number of past pairings to consider when creating new pairings. Defaults to 3.
To run people_pairer using data stored in the sample_data folder, ensuring that pairs are not repeated from the previous 5 iterations, the uv command would be:
uv run -m people_pairer.main --data_filepath sample_data --past_pairings 5.
Without uv, it would be python -m people_pairer.main --data_filepath sample_data --past_pairings 5
This package is maintained by @yiwen-h. Contributions are very welcome, and please feel free to raise any issues you may encounter.
The files generated by this package are designed to be used with the rct_streamlit and rct_api packages for automating the sending of emails to the generated pairs. They aren't necessary but may be useful additional tools.