We have done our background research and figured out the basic strategies we’ll start with. Now it’s time to start building our optimizer and start winning some Daily Fantasy Baseball contests on FanDuel and DraftKings. If you’d like to follow along and apply what you read about, this post will help you get your computer set up to write and run the code we’ll get into as we build this optimizer.
Don’t worry, all of the posts that follow will make sense and be helpful and interesting even if you choose not to code along with me. But I wanted to help get you set up so you can take this project further, or build your own optimizer with your favorite DFS strategies.
3 Simple Setup Options
I’ve personally used the Python.org option for my projects, including this one. While it’s a great choice and the one I personally prefer, I believe Visual Studio Code and Replit might be easier for those with little coding experience. In this post, I’ll guide you through setting up Python with the packages we’ll need for our optimizer (PuLP and Beautiful Soup) using these three options. Choose the one that best suits your needs and comfort level.
- Visit the official Python website at https://www.python.org/downloads/ and download the appropriate version for your operating system.
- Install Python by following the on-screen instructions.
- Open a terminal or command prompt and type “pip install pulp beautifulsoup4” to install PuLP and Beautiful Soup.
- For a detailed, step-by-step guide, check out this helpful blog post: https://realpython.com/installing-python/
Visual Studio Code
- Download Visual Studio Code at https://code.visualstudio.com/ and install it.
- Open VS Code and install the Python extension from the marketplace.
- Set up your Python interpreter in VS Code following this guide: https://code.visualstudio.com/docs/python/python-tutorial#_prerequisites
- Open a terminal in VS Code and type “pip install pulp beautifulsoup4” to install PuLP and Beautiful Soup.
- For a comprehensive tutorial on setting up Visual Studio Code for Python, visit this blog post: https://python.land/vscode-python
- Go to the Replit website at https://replit.com/ and sign up for a free account.
- Click “Create” and select “Python” to start a new Python project.
- On the left sidebar, click “Packages” and search for “pulp” and “beautifulsoup4”. Click the “+” button next to each package to install them.
- Your online coding environment is now ready for use.
- For a more in-depth guide on getting started with Replit, refer to this blog post: https://www.freecodecamp.org/news/how-to-use-replit/
These three options offer different ways to set up Python with PuLP and Beautiful Soup. Take your pick, and you’ll be ready to build your daily fantasy baseball lineup optimizer with me!
Now for the fun part – let’s get to building! This concludes the background research and general strategy portion of these posts. Next we’ll start talking about how to set up a daily fantasy sports lineup as a math problem that we can solve. And more importantly: solve optimally.
If you want to play along and enter some FanDuel lineups of your own, you can use my FanDuel referral link here to get a deposit bonus. You should just need to deposit at least $15 within 30 days of signing up, and you’ll get a $15 bonus added to your account if you use that link.
Click here for previous post: How Many Daily Fantasy Tournament Lineups Should I Enter?
Click here for next post: Solving Optimization Problems in Calculus: A Daily Fantasy Baseball Connection
Click here to view the Table of Contents for other DFS Picks
Some links in this article may be affiliate links or referral links, meaning I would get a small commission for your purchase at no additional cost to you.