A command line random picker for python.
usage: pypicker.py [-h] [-i PATH] [-g INTEGER] [-o PATH] [-j DELIMITER] [-v]
[-u] [--version]
[SAMPLE SIZE] [SAMPLE GROUP [SAMPLE GROUP ...]]
Randomly pick items from a list
positional arguments:
SAMPLE SIZE number of items to pick (default: 1)
SAMPLE GROUP list of items to choose from.
optional arguments:
-h, --help show this help message and exit
-i PATH input file of items to choose from
-g INTEGER number of result groups to generate (default: 1)
-o PATH output file to write results to
-j DELIMITER join results using specified delimiter
-v, --verbose verbose output
-u, --unique force uniqueness across result groups
--version show program's version number and exit
Created by Jason Bristol <json.bristol@gmail.com>
$ python pypicker.py 2 a b c d
c
a
$ python pypicker.py -i test_input.txt
Yolanda Holland
$ python pypicker.py 4 -i test_input.txt -g 4 -v
Picking 4 item(s) out of 29:
Faith Boone
Hilda Mullins
Lewis Potter
Leona Evans
Picking 4 item(s) out of 29:
Francisco Williams
Yolanda Holland
Ellis Jennings
Danielle Gill
Picking 4 item(s) out of 29:
Jessica Mitchell
Renee Willis
Betty Lane
Yolanda Holland
Picking 4 item(s) out of 29:
Hilda Mullins
Jessica Mitchell
Boyd Hunter
Wilson Marshall
$ python pypicker.py 4 -i test_input.txt -g -v -u
Picking 4 item(s) out of 25:
Danielle Gill
Boyd Hunter
Amos Warner
Leona Evans
Picking 4 item(s) out of 21:
Ellis Jennings
Francisco Williams
Renee Willis
Herbert Ball
Picking 4 item(s) out of 17:
Mindy Lopez
Faith Boone
Hilda Mullins
Lucille Clayton
Picking 4 item(s) out of 13:
Yolanda Holland
Trevor Goodman
Lewis Potter
Betty Lane
$ python pypicker.py 4 -i test_input.txt -o test_ouptut.txt
test_output.txt
Faith Boone
Leona Evans
Boyd Hunter
Phillip Bailey
$ python pypicker.py 4 -i test_input.txt -j ', '
Shirley Joseph, Brandon Rice, Ellis Jennings, Anita Larson