BenBrostoff / draftfast

A tool to automate and optimize DraftKings and FanDuel lineup construction.
287 stars 113 forks source link

Build and add instructions not running as a CLI #85

Closed BenBrostoff closed 5 years ago

BenBrostoff commented 5 years ago

From discussions with people using this project (and my own workflow), I realize run is the core functionality most people care about (and that's a bad name - it really should be called optimize).

This would be exposed in a pip module if I ever ship one. Ideally, this library could be easily added to whatever scripts people have for their DFS workflow and it could be extended to any game that has positions, players and salaries. So if a new website or DFS game pops up, it would be easy to do something like:

import GameRules from draft_kings_fun

...
game_rules = GameRules(roster_size=10, position_limits=[['UTIL', 6]], salary_cap=30000)
roster = run(
  game_rules=game_rules,
  ...
)

The reason this isn't possible now is that run takes a Namespace object from argparser. This interface doesn't make sense and needs to be changed. While I still want to maintain the CLI - I often find it useful for experimenting with different strategies - there can be a layer between the CLI and the pip module so they can speak to each other. Said another way, the CLI should be independent from the library exposed by pip.

This also should remove run / optimize's dependency on passing CSV file paths to it.

BenBrostoff commented 5 years ago

Closing because this is implemented and this project no longer runs as a CLI.