yfpy.models.Manager

class Manager(extracted_data)[source]

Bases: YahooFantasyObject

Model class for “manager” data key.

Instantiate the Manager child class of YahooFantasyObject.

Parameters:

extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.

email

The email address of the manager.

Type:

str

emails

(for Survival Football) List of email addresses for the manager competing in the contest.

Type:

list[str]

fantasy_profile_url

(for Survival Football) The direct URL for the profile of the manager competing in the contest.

Type:

str

felo_score

The manager fantasy ELO rating.

Type:

int

felo_tier

The manager fantasy ELO level (Bronze, Silver, Gold, Platinum, Diamond).

Type:

str

guid

The unique Yahoo GUID of the user account associated with manager.

Type:

str

image_url

The direct URL of the manager profile image.

Type:

str

is_comanager

Numeric boolean (0 or 1) representing if the manager is a co-manager.

Type:

int

is_commissioner

Numeric boolean (0 or 1) representing if the manager is commissioner of the league from which the manager data is being retrieved.

Type:

int

is_current_login

Numeric boolean (0 or 1) representing if the manager is the current user authenticated with the Yahoo Fantasy Sports REST API.

Type:

int

manager_id

The unique manager ID in the league.

Type:

int

nickname

The display nickname of the manager.

Type:

str

profile_image_url

(for Survival Football) The direct URL of the profile image of the manager competing in the contest.

Type:

str

Methods

clean_data_dict

Recursive method to un-type custom class type objects for serialization.

from_json

Deserialize JSON to a class object.

serialized

Pack up all object content into nested dictionaries for JSON serialization.

subclass_dict

Derive snake case dictionary keys from custom object type camel case class names.

to_json

Serialize the class object to JSON.

clean_data_dict()

Recursive method to un-type custom class type objects for serialization.

Returns:

Dictionary that extracts serializable data from custom objects.

Return type:

dict

classmethod from_json(json_data)

Deserialize JSON to a class object.

Returns:

Class object derived from JSON data.

Return type:

object

serialized()

Pack up all object content into nested dictionaries for JSON serialization.

Returns:

Serializable dictionary.

Return type:

dict

subclass_dict()

Derive snake case dictionary keys from custom object type camel case class names.

Returns:

Dictionary with snake case strings of all subclasses of YahooFantasyObject as keys and subclasses as values.

Return type:

dict

to_json()

Serialize the class object to JSON.

Returns:

JSON string derived from the serializable version of the class object.

Return type:

str