Rankings endpoints for NFL Draft Buzz.
Provides get_position_rankings() to fetch and parse position
ranking pages.
Rankings
Rankings(sdk_config, parent_ref=None)
Bases: BaseSDK
Sub-SDK for DraftBuzz position rankings pages.
Source code in src/griddy/draftbuzz/basesdk.py
| def __init__(
self,
sdk_config: SDKConfiguration,
parent_ref: Optional[object] = None,
) -> None:
"""Initialize DraftBuzz BaseSDK with scraping backends for HTML fetching.
The scraping backend is resolved in the following order:
1. A backend stored on ``sdk_config.scraping_backend`` (set when the
user passes ``scraping_backend`` to :class:`GriddyDraftBuzz`).
2. A default :class:`PlaywrightBackend` instance using Firefox.
Args:
sdk_config: DraftBuzz SDK configuration with server details.
parent_ref: Optional reference to the parent SDK instance.
"""
super().__init__(sdk_config=sdk_config, parent_ref=parent_ref)
if sdk_config.scraping_backend is not None:
self.scraper = sdk_config.scraping_backend
else:
headless = getattr(self, "_headless", True)
from .utils.playwright import PlaywrightBackend
self.scraper = PlaywrightBackend(headless=headless)
if sdk_config.async_scraping_backend is not None:
self.async_scraper = sdk_config.async_scraping_backend
else:
headless = getattr(self, "_headless", True)
from .utils.playwright import AsyncPlaywrightBackend
self.async_scraper = AsyncPlaywrightBackend(headless=headless)
|