GithubHelp home page GithubHelp logo

joiellantero / name-roulette Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 1.0 2.66 MB

Python program that chooses a random name from a csv or text file

License: MIT License

Python 100.00%
python python3 name-roulette pandas pandas-python pandas-dataframe multithreading cowsay random-names random-picker

name-roulette's Introduction

 ________   ________  _____ ______   _______           ________  ________  ___  ___  ___       _______  _________  _________  _______      
|\   ___  \|\   __  \|\   _ \  _   \|\  ___ \         |\   __  \|\   __  \|\  \|\  \|\  \     |\  ___ \|\___   ___\\___   ___\\  ___ \     
\ \  \\ \  \ \  \|\  \ \  \\\__\ \  \ \   __/|        \ \  \|\  \ \  \|\  \ \  \\\  \ \  \    \ \   __/\|___ \  \_\|___ \  \_\ \   __/|    
 \ \  \\ \  \ \   __  \ \  \\|__| \  \ \  \_|/__       \ \   _  _\ \  \\\  \ \  \\\  \ \  \    \ \  \_|/__  \ \  \     \ \  \ \ \  \_|/__  
  \ \  \\ \  \ \  \ \  \ \  \    \ \  \ \  \_|\ \       \ \  \\  \\ \  \\\  \ \  \\\  \ \  \____\ \  \_|\ \  \ \  \     \ \  \ \ \  \_|\ \ 
   \ \__\\ \__\ \__\ \__\ \__\    \ \__\ \_______\       \ \__\\ _\\ \_______\ \_______\ \_______\ \_______\  \ \__\     \ \__\ \ \_______\
    \|__| \|__|\|__|\|__|\|__|     \|__|\|_______|        \|__|\|__|\|_______|\|_______|\|_______|\|_______|   \|__|      \|__|  \|_______|

Name Roulette

A simple command line program that randomly selects a name from a list.

License

Features

  1. Randomly choose a name from a .csv or .txt file.

  2. Settings

    Positional Arguments Desciption
    filename A .csv or .txt file containing the list of names. The names should be separated by new line. See Names Database for examples.
    amount The number of random people to be chosen in one go.
    Optional Arguments Desciption
    --repeat With flag: select a random name (without removing it from the list) forever.
    Without flag (default): select a random name (and remove it from the list) until the list is empty.
    --display Show the list of names.
    --cowsay Show chosen name/s with cowsay illustration.

Getting Started

Prerequisite: Python 3 must be installed.

  • Download the latest release or clone the repository

    git clone https://github.com/joiellantero/name-roulette.git
  • Navigate to the directory of the project.

  • Create a virtual environment.

    virtualenv env
  • Activate the virtual environment.

    for macOS and linux

    source env/bin/activate

    for windows

    Scripts/activate.bat
  • Install the dependencies

    pip install -r requirements.txt
  • Run the program

    Format: python3 name-roulette.py <fileName> <amount> <flags>

    python3 name-roulette.py names.csv 3 --cowsay

Names Database

The names to be used in the program are read from either a .csv or .txt file. This repository includes examples of the files mentioned. Proper formatting should be followed in creating these files.

An example formatting for the .csv file is shown below. Notice that there is no column name and each name is entered in a new row under one column.

names.csv

eren
mikasa
armin
levi
hange
erwin
sasha
jean

An example formatting for the .txt file. Notice that each name is entered in a new line.

names.txt

connie
historia
annie
reiner
pieck
falco

The Future

  • I'm currently developing an open-source website version of this and I'm building it using ReactJS and Tailwind CSS.

Author

  • Joie Llantero

License

name-roulette's People

Contributors

joiellantero avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

leopedrozo

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.