Skip to main content

A tool to get certain data from DraftKings

Project description

About this project

This tool was created to help manage a DraftKings league as the commissioner. It used to be a script that was used to generate a blog post template for Platanofb.com, a GitHub Pages project. Now, this tool is a group of functions that can be called to return data, which makes integration with other projects, like a Flask website, possible.

One of the new features is login_to_dk() which logs in to DraftKings and store the cookies to a file; this enables getting contest details automatically, an improvement over downloading the contest results CSV and supplying the file to the old script. A wiki will be updated to describe usage of each function, although they are appropriately named and coments are included inline with the code.

Storing DraftKings credentials

By default, this tool will look for DraftKings credentials in ./private_data.py. The file should look like this:

creds = '{"login":"YOUR@EMAIL.COM","password":"YOUR_PASSWORD","host":"api.draftkings.com","challengeResponse":{"solution":"","type":"Recaptcha"}}'

To-do list

  • get_latest_contest_id(): Get the contestId of the latest contest for the logged in user
  • get_week() & get_year(): figure out if the date and year can be extracted from DraftKings responses to existing POST and GET requests. Possibly something related to the contest_id.
  • Create a wiki

Thank you

Thanks for taking a look at my tool. Please feel free to provide feedback or suggestions, but notice, this code was created and written for fun.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dkextract-1.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

dkextract-1.1-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page