I wrote up an article on medium detailing the code which you can find here. But since you're already here at my repository you can just clone it and run the code.
After you clone the repo, log into your DraftKings account and download the daily roster for NHL contests. Make sure to put the downloaded CSV file into the repo. Than execute the program like so:
$ python genetic_algorithm.py
That's it! Now you have lineups in a CSV file ready to upload directly into DraftKings.