Package: sinterbot
Sinterbot2020sinterbotis a little command line program (Python 3.5+) that helps to manage secret santa assignments. Withsinterbotyou can generate a valid secret santa assignment for a list of people and email each person their assigned gift recipient without ever revealing to anybody (including the operator ofsinterbot) the full secret list of assignments.For some of the theory and motivation behindsinterbot, see my weblog postDeranged Sinterklaas: The Math and Algorithms of Secret Santasinterbotallows specifying some extra constraints such as minimum cycle length or a blacklist of people who should not be assigned to each other.InstallationUse the package managerpipto install sinterbot.pipinstallsinterbotUsageFirst create a config file with a list of participants' names and email addresses. The config file may also specify constraints for minimum cycle length and a blacklist. Seesample.conffor a full example:# xmas2020.conf
Santa A: user1@email.tld
Santa B: user2@email.tld
Santa C: user3@email.tld
Santa D: user4@email.tld
Santa E: user5@email.tldThe format isName: emailaddress. Only the email addresses need to be unique.Then runsinterbot derangeto compute a valid assignment and save it to the config file:$sinterbotderangexmas2020.conf
Derangementinfosuccessfullyaddedtoconfigfile.
Use`sinterbotsendsample.conf-csmtp.conf`tosendemails!sinterbotwill not allow you to re-derange a config file without passing the--forceflag.Now if you want you can view the secret santa assignments withsinterbot view xmas2020.conf. However, if you're a participant that would ruin the suprise for you! Instead you can email each person their assignment without ever seeing them yourself:$sinterbotsendxmas2020.conf-csmtp.conf
Sendmessagetouser1@email.tld!
Sendmessagetouser2@email.tld!
Sendmessagetouser3@email.tld!
Sendmessagetouser4@email.tld!
Sendmessagetouser5@email.tld!Before you can run thesinterbot sendyou need to create a file for your SMTP credentials:# smtp.conf## These settings are used to send the assignment emails. SMTPEmail will appear# as the 'From:' address in the sent emails## If SMTPUser is blank, SMTPEmail will be used as the user credentials.## If SMTPPass is blank, the program will look for it in an environment variable# called "sinter_smtp_pass" instead.SMTPEmail:yourname@gmail.com#SMTPUser:SMTPPass:yourgmailpassword
SMTPServer:smtp.gmail.com
SMTPPort:587(If you do not know what SMTP server to use but you have a gmail account, you canuse gmail's SMTP serverusing values like those exemplified above (you will need togenerate an app password.)To get full usage info runsinterbot --help. You can also pass--helpto each subcommand:$sinterbot--help
usage:sinterbot[-h]{derange,check,send,view}...

positionalarguments:{derange,check,send,view}derangeRead.configfileandaddderangementinformationtoit.checkCheckthattheconfigfilecontainsavalidderangementsendSendeverysantaanemailwiththenameoftheirassignedrecipient.viewShowthelistofsecretsantaassignments.

optionalarguments:-h,--helpshowthishelpmessageandexitFeedbackPlease feel free to use the Githubissuesto report bugs, ask questions, or make suggestions.HackingClone repo:$gitclonehttps://github.com/cristoper/sinterbot.git
$cdsinterbot/Run tests:$python-munittestdiscoverCheck types:mypysinterbot/*.pybin/*.pyLicenseMIT