Skip to content

mowsec/lego-prize-draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧱 LEGO Prize Draw CLI Tool 🎁

Because choosing a winner should be as fun as building with LEGOs!

A delightfully silly command-line tool for conducting prize draws at conferences, meetups, or anywhere you need to pick winners in the most dramatic way possible. Built with Python, Rich console formatting, and an unhealthy amount of enthusiasm for LEGO sets!

✨ Features

  • 🎭 Dramatic Winner Selection: Complete with spinning monkey animation and suspenseful catchphrases
  • 📊 Smart CSV Parsing: Handles various CSV formats and column naming conventions
  • 🎨 Beautiful ASCII Art: Winners get their names displayed in glorious ASCII art
  • 🔄 Absent Winner Handling: Automatically picks a new winner if the selected person isn't present
  • 🎪 Conference-Ready: Perfect for tech conferences, meetups, and office parties

🎬 See It In Action

asciicast

Click the image above to see the tool in action!

🚀 Quick Start

Prerequisites

pip install typer rich art

Usage

python lego_prize_draw.py pick-a-winner

Or with a custom entries file:

python lego_prize_draw.py pick-a-winner --entries-file my-participants.csv

Help

python lego_prize_draw.py --help

🎯 Main Functions

1. 🎲 Prize Draw Selection by name (pick-a-winning-name)

The star of the show! This function:

  • Reads participant data from a CSV file
  • Asks if you want to check the entries (spoiler: you do!)
  • Dramatically selects a random winner with animated suspense
  • Displays the winner's name in beautiful ASCII art
  • Handles the awkward "winner isn't here" situation by picking someone else
  • Keeps going until someone actually claims their prize!

What makes it special:

  • Animated spinner with a monkey emoji (because why not?)
  • Suspenseful catchphrases that build anticipation
  • Zero-indexed random selection (no off-by-one errors here!)
  • Graceful error handling for missing files or invalid data

2. 🎲 Prize Draw Selection by number (pick-a-winning-number)

For more sensitive events where anonymity is key (or for when you can't get your hands on a CSV file), this function:

  • All the same drama and flair as the name-based draw but only displaying the winning number
  • You'll need to manually lookup the name associated with the winning number

Supported CSV formats:

  • Separate columns: First Name, Last Name
  • Alternative naming: firstname, lastname, given, surname, prenom, nom de famille
  • Single column: Full Name, Name, Participant, Attendee
  • Mixed case and spacing variations

Smart features:

  • Automatically detects column naming conventions
  • Falls back to full name splitting if separate columns aren't available
  • Provides helpful feedback about which columns it's using
  • Validates data and reports any issues

🎭 Why This Project Exists

Sometimes you need to pick winners for conference swag, and sometimes that swag happens to be LEGO sets. When that happens, you don't just want a boring random number generator or the overused Number Picker Wheel - you want drama, you want suspense, you want a monkey spinner!

This tool was born from the realization that if you're giving away something as awesome as LEGO sets, the selection process should be equally awesome.

🛠️ Technical Bits

  • Python 3.7+ (because type hints are lovely)
  • Typer for the CLI magic
  • Rich for beautiful console output
  • Art for ASCII text generation
  • CSV handling that's more flexible than a LEGO joint

🎪 Conference Tips

  1. Test your CSV file first - run the tool with --help to make sure everything works
  2. Have a backup plan - keep a physical list just in case technology decides to be dramatic
  3. Practice your dramatic flair - the tool provides the suspense, but you provide the showmanship!
  4. Bring extra LEGO sets - trust me on this one

📜 License

This project is licensed under the "Do Whatever You Want With It But Please Give Me Credit If You Use It At A Conference" license.

Also known as MIT. 🎉


May the odds be ever in your favor! 🧱✨

About

A delightfully silly command-line tool for conducting prize draws at conferences, meetups, or anywhere you need to pick winners in the most dramatic way possible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages