Skip to content

Prospects

prospects

Prospect endpoints for NFL Draft Buzz.

Provides get_prospect() to fetch and parse a complete prospect profile including stats from two separate page fetches.

Prospects

Prospects(sdk_config, parent_ref=None)

Bases: BaseSDK

Sub-SDK for DraftBuzz prospect profile 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)

get_prospect

get_prospect(*, slug, position, timeout_ms=None)

Fetch a complete prospect profile including stats.

Makes two requests: one for the profile page and one for the stats page, combining results into a single ProspectProfile.

Parameters:

Name Type Description Default
slug str

The prospect URL slug (e.g. "players/cam-ward-qb-2025").

required
position str

Canonical position group (e.g. "QB", "WR").

required
timeout_ms Optional[int]

Optional timeout in milliseconds.

None

Returns:

Name Type Description
A ProspectProfile

class:~griddy.draftbuzz.models.ProspectProfile with all

ProspectProfile

fields populated including stats.

Source code in src/griddy/draftbuzz/endpoints/prospects.py
def get_prospect(
    self,
    *,
    slug: str,
    position: str,
    timeout_ms: Optional[int] = None,
) -> ProspectProfile:
    """Fetch a complete prospect profile including stats.

    Makes two requests: one for the profile page and one for the
    stats page, combining results into a single ``ProspectProfile``.

    Args:
        slug: The prospect URL slug (e.g.
            ``"players/cam-ward-qb-2025"``).
        position: Canonical position group (e.g. ``"QB"``, ``"WR"``).
        timeout_ms: Optional timeout in milliseconds.

    Returns:
        A :class:`~griddy.draftbuzz.models.ProspectProfile` with all
        fields populated including stats.
    """
    config = self._get_prospect_config(
        slug=slug, position=position, timeout_ms=timeout_ms
    )
    profile: ProspectProfile = self._execute_endpoint(config)

    # Fetch stats from separate page
    stats = self._fetch_stats(slug=slug, position=position)
    if stats is not None:
        profile = profile.model_copy(update={"stats": stats})

    return profile

get_prospect_async async

get_prospect_async(*, slug, position, timeout_ms=None)

Async version of :meth:get_prospect.

Source code in src/griddy/draftbuzz/endpoints/prospects.py
async def get_prospect_async(
    self,
    *,
    slug: str,
    position: str,
    timeout_ms: Optional[int] = None,
) -> ProspectProfile:
    """Async version of :meth:`get_prospect`."""
    config = self._get_prospect_config(
        slug=slug, position=position, timeout_ms=timeout_ms
    )
    profile: ProspectProfile = await self._execute_endpoint_async(config)

    stats = await self._fetch_stats_async(slug=slug, position=position)
    if stats is not None:
        profile = profile.model_copy(update={"stats": stats})

    return profile