Lunch Roulette is a tool for finding diverse dining groups among coworkers and friends. It uses staff data (stored in Google Sheets or in CSV form) to generate small lunch groups of people from different teams and tenures who haven't dined together before.
With a single command, Lunch Roulette will download staff data and participation survey results from Google Sheets, scan through thousands of possible lunch groups until it finds the best one, update the Google Sheet with the results, and print out the emails of each group for dispersal.
This is a forked version of the original Lunch Roulette, written and blogged about by Fred Benenson 🐋.
Lunch Roulette is a command line application written in Ruby. It requires a CSV file with staff information and "features," such as their team, manager, and start date. This file can live offline in CSV form, or it can exist as a Google Sheet which Lunch Roulette accesses through the Google Sheets API.
It is run using the ruby executable:
ruby lib/lunch_roulette.rb
Features are things like the team that a person is on, or the day they started. These features can be weighted in different ways and mapped so that some values are "closer" to others. These weights and mappings are stored in a config file.
Other configurable options can be set at runtime, such as the path to an offline source CSV, the number of iterations to perform, and the ability to stop the search when the first valid lunch set is found.
Usage: ruby lunch_roulette.rb [OPTIONS]
-f, --file F Offline people input: read people data from provided CSV
-o, --offline Offline output: write timestamped CSV data locally to output directory
-s, --survey read survey data from configured Google sheet
-i, --iterations I Iterations, default 1000
-v, --valid Stop searching when the first valid set is encountered
-c, --concise Concise output: suppress stats and previous-lunches printouts
-h, --help Print this help
So that you can run Lunch Roulette out of the box, I've provided a dummy staff (thanks to Fred Benenson for using Namey to create the hilariously fake names) dataset in data/people_sample.csv
Lunch Roulette has a lot of configurable things, such as the id of your staff Google Sheet, the weights of different diversity measures, and the format of different date strings. This is all set up in config/config.yml
.
For first time users, copy the example config config/config.yml.example
to config/config.yml
and insert your own personal values as you see fit!
One way Lunch Roulette computes team-based diversity is through a configurable one-dimensional mapping from teams to integers. This is a crude but effective way to approximate the relative "distance" between any two teams.
team_mappings:
Engineering: 0
Data: 10
Product: 20
Design: 30
Marketing: 40
Outreach: 50
Community Support: 60
Integrity: 70
Communications: 80
Operations: 90
Exec: 110
Lunch Roulette expects all employees to have a team (Community, Design, etc.) and a manager (the name of another teammate), though it won't break if either of these are missing.
Lunch Roulette is designed to be a one-command affair, and to do so it leverages the Google Sheets API to download and update your people data direct from a Google Sheet. To set this up a few things have to be configured first with Google. Follow their quickstart guide for Ruby scripts to get yourself situated.
If you want to survey your coworkers to see who is lunchable, Lunch Roulette is equipped to use those responses to make its groups. Just make a Google Form with a yes or no question, and point Lunch Roulette to the spreadsheet of survey results. It will download those and link them to users by email address.
The original Lunch Roulette algorithm gave every lunch group an id, starting from 1 and increasing incrementally. This made it hard to tell which previous lunch groups occurred on the same day, and moreover it made it hard to tell just how far in the past each previous lunch actually took place.
In this version of Lunch Roulette, lunches have two ids: a set_id
and a group_id
. For example, lunch 13-9
represents the 9th lunch group in the 13th edition of Lunch Roulette. This makes it easy to tell how far back in time a user's previous lunch was. So if you and I both were in lunch group 13-9
, and today we get put into group 20-10
, we can tell at a glance that it's been 7 session since we last dined together (20 - 13 = 7).
If you have been using the legacy version of Lunch Roulette with the single-id system, fear not. I've included a conversion script convert_legacy_data.rb
that will automatically determine and record the set_id
-group_id
versions of all your staff's previous lunches.