dk

draft-kings

Client for DraftKings API

Showing:

17 Versions

3.1.0

Summary

Implemented in PR #104.

Adds a Client().game_type_rules(game_type_id=1) method.

2.0.3

Summary

#42 updates the version of the urllib3 library to 1.25.9 to avoid vulnerabilities associated with version 1.24.3.

This also meant upgrading the associated requests library version because the previous version of 2.20.0 explicitly only allowed urllib3 < 1.25.

By upgrading requests to 2.22.0, urllib3@1.25.9 was allowed.

3.0.0

This v3.0.0 release of the DraftKings client improves on the internals of the client while also (hopefully) providing a nicer output API for developers.

The use of the marshmallow library

The marshmallow library is used to deserialize the response from draftkings.com endpoints into data class objects.

These classes use the dataclasses module introduced in Python 3.7.

These data objects are then processed / transformed into data class objects exposed by the client's public API.

Outputting objects

A breaking change from v2.x is that the client now returns explicit classes vs. dicts.

This is done for two reasons

  1. Using explicit classes makes it easier to use type hinting when reading data from the client (as well as making the developer experience better when working on changes inside the project, IMHO)
  2. marshmallow + explicit classes makes it easy to take a class instance and serialize it into some other format (like plain old dicts or JSON)
Client class vs. exported functions

Another breaking change from v2.x is that in v2.x, the API was a series of functions that could be imported from a module.

In v3.0.0, the proper way of using the API is to import the Client from the draft_kings module, instantiate it, and then call the relevant methods on the instantiated Client instance.

2.0.2

Summary

Includes #40 (which closed #37) which is supposed to fix TypeErrors associated with null start times for a player's draft metadata.

2.0.1

Contains #35 which fixes a bug around the contest response translator.

This is a backwards-incompatible change but it was done to fix a bug with contest response being a list instead of a list of lists, hence the patch upgrade instead of a major version upgrade.

#35 also updated documentation and examples.

This also adds a sport field to the contest draft group response translation.

2.0.0

V2 of the DraftKings Client (#27)

A cleaner (hopefully) implementation that also provides a cleaner interface.

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.0