Code Monkey home page Code Monkey logo

secretsanta's Introduction

Secret Santa

by Toria Gibbs and Justin Michel

A simple python script for Secret Santa gift assignments. The script creates a cycle of all users in random order and emails the assignments to each user from a specified gmail account.

BONUS: Cat Mode! The script supports two 'types' of Secret Santa:

  1. simple: Assigns only a name, intended for in-person Secret Santa exchanges (no mailing address, due date, additional notes)
  2. cats: Your assignee is 1 or more cats! Originally written for Etsy's Cats@ Secret Santa 2015, this mode supports cats' names, mailing location, and additional notes from the recipient cats' owner.

Setup

It's simple! Download (cut and paste or git clone/fork) the SecretSanta.py file and make the following preparations:

  • Create a CSV file (Excel, Google Spreadsheets, etc. can export to CSV format) with your participants information. See examples in the examples directory.
    • Each row has the format [name, email, cats' names, address, notes]
    • For a 'simple' Secret Santa, only name and email are required
  • Consider asking a friend to send the emails, as they will show up in the sender's outbox!

Usage

usage: SecretSanta.py [-h] [-m {test,longtest,exec}] [-t {simple,cats}]
                      [-e EMAIL] [-u USERNAME] [-p PASSWORD] [-r {gmail}]
                      [-d DUE_DATE]
                      participants_file

Secret Santa

positional arguments:
  participants_file     CSV file containing participant info

optional arguments:
  -h, --help            show this help message and exit
  -m {test,longtest,exec}, --mode {test,longtest,exec}
  -t {simple,cats}, --type {simple,cats}
  -e EMAIL, --email EMAIL
                        email address to send from
  -u USERNAME, --username USERNAME
                        username for email account
  -p PASSWORD, --password PASSWORD
                        password for email account
  -r {yahoo,gmail}, --provider {yahoo,gmail}
                        email provider
  -d DUE_DATE, --due-date DUE_DATE
                        due date in YYYY-MM-DD format

The username and password arguments can be omitted and will be prompted for if necessary. For example, ./SecretSanta.py -e [email protected] -d 2015-12-15 -m exec -t cats 2015_secret_santa.csv

  • Runs with mode=test, type=simple, and provider=gmail by default
  • Trouble authenticating with Google SMTP? Try enabling less secure apps.
Mode Description
test Test mode: prints simple 1-line assignments to console
longtest Test mode: prints complete constructed emails to console
exec Execute mode: sends email assignments, no print to console
Type Description
simple Simple Secret Santa assigns by name
cats Cats Secret Santa assigns by cats and includes owner's name, mailing location, and notes about the cats

secretsanta's People

Contributors

cirla avatar toriagibbs-zz avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.