lunchable
#
Lunch Money Python SDK
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
__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
LunchMoneyError
#
TransactionInsertObject
#
Bases: TransactionBaseObject
Object For Creating New Transactions
https://lunchmoney.dev/#insert-transactions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date
|
Must be in ISO 8601 format (YYYY-MM-DD). |
required |
amount |
float
|
Numeric value of amount. i.e. $4.25 should be denoted as 4.25. |
required |
category_id |
int | None
|
Unique identifier for associated category_id. Category must be associated with the same account and must not be a category group. |
None
|
payee |
str | None
|
Max 140 characters |
None
|
currency |
str | None
|
Three-letter lowercase currency code in ISO 4217 format. The code sent must exist in our database. Defaults to user account's primary currency. |
None
|
asset_id |
int | None
|
Unique identifier for associated asset (manually-managed account). Asset must be associated with the same account. |
None
|
recurring_id |
int | None
|
Unique identifier for associated recurring expense. Recurring expense must be associated with the same account. |
None
|
notes |
str | None
|
Max 350 characters |
None
|
status |
StatusEnum | None
|
Must be either cleared or uncleared. If recurring_id is provided, the status will automatically be set to recurring or recurring_suggested depending on the type of recurring_id. Defaults to uncleared. |
None
|
external_id |
str | None
|
User-defined external ID for transaction. Max 75 characters. External IDs must be unique within the same asset_id. |
None
|
tags |
List[Union[str, int]] | None
|
Passing in a number will attempt to match by ID. If no matching tag ID is found, an error will be thrown. Passing in a string will attempt to match by string. If no matching tag name is found, a new tag will be created. |
None
|
Source code in lunchable/models/transactions.py
TransactionSplitObject
#
Bases: TransactionBaseObject
Object for Splitting Transactions
https://lunchmoney.dev/#split-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date
|
Must be in ISO 8601 format (YYYY-MM-DD). |
required |
category_id |
int | None
|
Unique identifier for associated category_id. Category must be associated with the same account. |
None
|
notes |
str | None
|
Transaction Split Notes. |
None
|
amount |
float
|
Individual amount of split. Currency will inherit from parent transaction. All amounts must sum up to parent transaction amount. |
required |
Source code in lunchable/models/transactions.py
TransactionUpdateObject
#
Bases: TransactionBaseObject
Object For Updating Existing Transactions
https://lunchmoney.dev/#update-transaction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date | None
|
Must be in ISO 8601 format (YYYY-MM-DD). |
None
|
category_id |
int | None
|
Unique identifier for associated category_id. Category must be associated with the same account and must not be a category group. |
None
|
payee |
str | None
|
Max 140 characters |
None
|
amount |
float | None
|
You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id |
None
|
currency |
str | None
|
You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id. Defaults to user account's primary currency. |
None
|
asset_id |
int | None
|
Unique identifier for associated asset (manually-managed account). Asset must be associated with the same account. You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id |
None
|
recurring_id |
int | None
|
Unique identifier for associated recurring expense. Recurring expense must be associated with the same account. |
None
|
notes |
str | None
|
Max 350 characters |
None
|
status |
StatusEnum | None
|
Must be either cleared or uncleared. Defaults to uncleared If recurring_id is provided, the status will automatically be set to recurring or recurring_suggested depending on the type of recurring_id. Defaults to uncleared. |
None
|
external_id |
str | None
|
User-defined external ID for transaction. Max 75 characters. External IDs must be unique within the same asset_id. You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id |
None
|
tags |
List[Union[str, int]] | None
|
Passing in a number will attempt to match by ID. If no matching tag ID is found, an error will be thrown. Passing in a string will attempt to match by string. If no matching tag name is found, a new tag will be created. |
None
|