export optimized lineups DFS Python
from pydfs_lineup_optimizer import get_optimizer, Site, Sport, CSVLineupExporter
optimizer = get_optimizer(Site.DRAFTKINGS, Sport.BASKETBALL)
optimizer.load_players_from_csv("players.csv")
# if you want to see lineups on screen
for lineup in optimizer.optimize(10):
print(lineup)
optimizer.export('result.csv')
# if you don't need to see lineups on screen
lineups = list(optimizer.optimize(10))
optimizer.export('result.csv')