Skip to main content

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 stores/loads cookies; 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 comments are included inline with the code.

Usage

Create a session to be passed to the functions of dkextract

import dkextract, requests

s = requests.session()
dkextract.get_all_players(session=s, week=1, year=2020)

DraftKings credentials and other values

This tool will look for DraftKings credentials in the following environment variables:

export DKUSER=dkuser@email.com
export DKPASS=dkp@ssw0rd

Some other values that are not obvious when using the tool:

all_members = set(["dk_username1", "dk_username2", "dk_username3"])
winning_values = {1: 100, 2: 50, 3: 25}
week1 = 'Sep 9, 2021 20:20:00'
  • all_members is a set of all DraftKings member names
  • winning_values is a value assigned to a rank. In this example, first place (rank 1 or 1:) is assigned a value of 100. Pass this to generate_results()
  • week1 is the date and time of the first game of the season.

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.

Metadata

Release files for dkextract 1.49

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dkextract 1.49
File Size Uploaded Provenance Actions
dkextract-1.49.tar.gz 44.8 kB Without provenance Details for dkextract-1.49.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dkextract 1.49
File Interpreter ABI Platform Actions
dkextract-1.49-py3-none-any.whl Python 3 none any Details for dkextract-1.49-py3-none-any.whl

Total release size: 76.9 kB

Release files / dkextract-1.49.tar.gz

Download URL dkextract-1.49.tar.gz
Size 44.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cbe6179392eff69b7c275dfb91d199244555cf48ec59c78ffcb74071c36b19f3
BLAKE2b-256 checksum
How to use checksums
8ba0924366976b8451764573b962c99556ae3575b73e6bd6529d5dfa38027cbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / dkextract-1.49-py3-none-any.whl

Download URL dkextract-1.49-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9a0a790fdeece57c440c24376ec4e36c39434033d489506ef0a167e7cddf8d2
BLAKE2b-256 checksum
How to use checksums
d776fed325b09e179c5118fca2326d25c991e3f4703954a92557aaf32596c5df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Security for dkextract 1.49

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page