Secret Santa picker and emailer with exclusions
Using magical algorithmic magic to create valid pairings, sending each person an email with their selection and then writing an output.csv file, replacing the person from last year with the person from this year.
This code is designed to use a gmail account and to take a .csv input containing the following rows:
Participant names
The person they got last year, to be excluded from the selection pool, may be blank
Their partner (spouse/etc), also to be excluded from the selection pool, may also be blank
Their email address
sample .csv is included.
Teaching myself Python so bear that in mind if some of my coding decisions seem...suboptimal.
Immense amount of credit goes to "BombsWisely" and his selection alogrithm code I found in pastebin (https://pastebin.com/a7yCDf95).