Skip to content

_lunchmoney#

Lunch Money Python Client

This Module Leverages Class Inheritance to distribute API Methods Across a series of clients. Ultimately, everything inherits from the lunchable.models.core.LunchMoneyAPIClient class which facilitates interacting with the API.

For example: to see source code on interactions with the "transactions" API endpoint you will refer to the TransactionsClient object.

LunchMoney #

Bases: AssetsClient, BudgetsClient, CategoriesClient, CryptoClient, PlaidAccountsClient, RecurringExpensesClient, TagsClient, TransactionsClient, UserClient, RecurringItemsClient

Lunch Money Python Client.

This class facilitates with connections to the Lunch Money Developer API. Authenticate with an Access Token. If an access token isn't provided one will attempt to be inherited from a LUNCHMONEY_ACCESS_TOKEN environment variable.

Examples:

from typing import List

from lunchable import LunchMoney
from lunchable.models import TransactionObject

lunch = LunchMoney(access_token="xxxxxxx")
transactions: List[TransactionObject] = lunch.get_transactions()
Source code in lunchable/models/_lunchmoney.py
class LunchMoney(
    AssetsClient,
    BudgetsClient,
    CategoriesClient,
    CryptoClient,
    PlaidAccountsClient,
    RecurringExpensesClient,
    TagsClient,
    TransactionsClient,
    UserClient,
    RecurringItemsClient,
):
    """
    Lunch Money Python Client.

    This class facilitates with connections to
    the [Lunch Money Developer API](https://lunchmoney.dev/). Authenticate
    with an Access Token. If an access token isn't provided one will attempt to
    be inherited from a `LUNCHMONEY_ACCESS_TOKEN` environment variable.

    Examples
    --------
    ```python
    from typing import List

    from lunchable import LunchMoney
    from lunchable.models import TransactionObject

    lunch = LunchMoney(access_token="xxxxxxx")
    transactions: List[TransactionObject] = lunch.get_transactions()
    ```
    """

    def __init__(self, access_token: Optional[str] = None):
        """
        Initialize a Lunch Money object with an Access Token.

        Tries to inherit from the Environment if one isn't provided

        Parameters
        ----------
        access_token: Optional[str]
            Lunchmoney Developer API Access Token
        """
        super(LunchMoney, self).__init__(access_token=access_token)

__init__(access_token=None) #

Initialize a Lunch Money object with an Access Token.

Tries to inherit from the Environment if one isn't provided

Parameters:

Name Type Description Default
access_token Optional[str]

Lunchmoney Developer API Access Token

None
Source code in lunchable/models/_lunchmoney.py
def __init__(self, access_token: Optional[str] = None):
    """
    Initialize a Lunch Money object with an Access Token.

    Tries to inherit from the Environment if one isn't provided

    Parameters
    ----------
    access_token: Optional[str]
        Lunchmoney Developer API Access Token
    """
    super(LunchMoney, self).__init__(access_token=access_token)