Examples¶
This section contains practical code examples demonstrating common use cases with the Griddy SDK.
Python Examples¶
- Basic Usage - Getting started with core SDK functionality
- Async Patterns - Asynchronous programming patterns
- Testing Strategies - Testing code that uses the SDK
- Fetching Player Stats - Working with player statistics
- Game Predictions - Building prediction models
- Fantasy Integration - Fantasy football applications
Quick Reference¶
Get Games¶
from griddy.nfl import GriddyNFL
nfl = GriddyNFL(nfl_auth={"accessToken": "token"})
games = nfl.games.get_games(season=2024, season_type="REG", week=1)
Get Player Stats¶
passing = nfl.stats.passing.get_passing_stats_by_season(season=2024)
rushing = nfl.stats.rushing.get_rushing_stats_by_season(season=2024)
receiving = nfl.stats.receiving.get_receiving_stats_by_season(season=2024)
Get Next Gen Stats¶
ngs_passing = nfl.ngs.stats.get_passing_stats(season=2024, season_type="REG")
ngs_rushing = nfl.ngs.stats.get_rushing_stats(season=2024, season_type="REG")