yfpy.data
YFPY module for retrieving, saving, and loading all Yahoo Fantasy Sports data.
This module is designed to allow for easy data management, such that both retrieving and managing Yahoo Fantasy Sports data can be done in one place without the need to manually run the queries and manage data saved to JSON files.
Example
The Data module can be used as follows:
auth_directory = Path(__file__).parent / "auth"
yahoo_query = YahooFantasySportsQuery(
auth_directory,
"<league_id>",
game_id="<game_key>",
game_code="<game_code>",
offline=False,
all_output_as_json_str=False,
consumer_key=os.environ["YFPY_CONSUMER_KEY"],
consumer_secret=os.environ["YFPY_CONSUMER_SECRET"],
browser_callback=True
)
data_directory = Path(__file__).parent / "output"
data = Data(data_dir)
data.save("file_name", yahoo_query.get_all_yahoo_fantasy_game_keys)
data.load("file_name")
- logger
Module level logger for usage and debugging.
- Type:
Logger
Classes
YFPY Data object for Yahoo Fantasy Sports data retrieval, saving, and loading data as JSON. |