A very simple Python script that randomly assignes a secret santa to a group of people, and sends an e-mail to all of the secret santa participants. You need Python 3 to run the script!
- Clone the repository via
git clone https://github.com/bokovhu/secret-santa-generator.git
- Run
pip install --upgrade google-api-python-client oauth2client
- Create a directory called
_env
in the directory you cloned the repository into - Head to https://developers.google.com/gmail/api/quickstart/python, and click the
ENABLE THE GMAIL API
button. A popup will appear, and you can download a JSON file via clickingDOWNLOAD CLIENT CONFIGURATION
- Save the downloaded JSON file with the name
credentials.json
inside the_env
directory - Create a file named
people
inside the_env
directory - Add all of the secret santa participants inside this file. Each line in the file is a person, with the format
PERSON NAME <PERSON EMAIL>
(for exampleJohn Doe <[email protected]>
) - Run
python secret-santa.py
, log into your Gmail account, and observe the Christmas miracle!