Skip to content

🧠 DogeAPI

The DogeAPI class provides a unified interface to all API endpoints in the DOGE SDK.

It wraps the lower-level client and injects SavingsAPI, and PaymentsAPI — all using a shared session and common flags.


📦 Class Reference

DogeAPI

DogeAPI(
    fetch_all: bool = False,
    output_pydantic: bool = True,
    handle_response: bool = True,
    run_async: bool = False,
    **client_kwargs
)

Unified entrypoint for interacting with all DOGE endpoints.

Attributes:

  • client (DogeAPIClient) –

    Shared client instance used across all endpoint classes.

  • savings (SavingsAPI) –

    Access to /savings endpoints.

  • payments (PaymentsAPI) –

    Access to /payments endpoints.

Parameters:

  • fetch_all

    (bool, default: False ) –

    Automatically fetch all pages for paginated endpoints.

  • output_pydantic

    (bool, default: True ) –

    If True, return Pydantic models. If False, return plain dicts with .export().

  • handle_response

    (bool, default: True ) –

    If True, decode responses. If False, return raw httpx.Response.

  • run_async

    (bool, default: False ) –

    If True, use asyncio-based pagination (if supported).

  • **client_kwargs

    (dict, default: {} ) –

    Passed to DogeAPIClient (e.g. base_url, timeout, headers).

Methods:

  • close

    Close the internal client session.

Source code in src/pydoge_api/api.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def __init__(
    self,
    fetch_all: bool = False,
    output_pydantic: bool = True,
    handle_response: bool = True,
    run_async: bool = False,
    **client_kwargs
):
    """
    Initialize DogeAPI with a shared DogeAPIClient and global endpoint config flags.

    Parameters
    ----------
    fetch_all : bool
        Automatically fetch all pages for paginated endpoints.
    output_pydantic : bool
        If True, return Pydantic models. If False, return plain dicts with .export().
    handle_response : bool
        If True, decode responses. If False, return raw httpx.Response.
    run_async : bool
        If True, use asyncio-based pagination (if supported).
    **client_kwargs : dict
        Passed to DogeAPIClient (e.g. base_url, timeout, headers).
    """
    self.fetch_all = fetch_all
    self.output_pydantic = output_pydantic
    self.handle_response = handle_response
    self.run_async = run_async

    self.client = DogeAPIClient(**client_kwargs)
    self.savings = SavingsAPI(client=self.client, api=self)
    self.payments = PaymentsAPI(client=self.client, api=self)

close

close()

Close the internal client session.

Source code in src/pydoge_api/api.py
52
53
54
def close(self):
    """Close the internal client session."""
    self.client.close()