Reference
Adjuster(credentials)
Abstract class which modifies transactions according to concrete implementation. You need to create your own
child class and implement the filter()and adjust() method in it according to your needs. It has attributes
which allow you to lookup categories and payees from your budget.
| Attributes: |
|
|---|
adjust(transaction, modifier)
abstractmethod
Function which implements the actual modification of a transaction. It receives the original transaction from YNAB and a prefilled modifier. The modifier can be altered and must be returned.
| Parameters: |
|
|---|
| Returns: |
|
|---|
apply()
Function which applies filter & adjust function on transactions as per implementation of the two methods.
| Returns: |
|
|---|
| Raises: |
|
|---|
fetch_transaction(transaction_id)
Fetches an individual transaction from the YNAB account
| Parameters: |
|
|---|
filter(transactions)
abstractmethod
Function which implements filtering for the list of transactions from YNAB account. It receives a list of the original transactions which can be filtered. Must return the filtered list or just the list if no filtering is intended.
| Parameters: |
|
|---|
| Returns: |
|
|---|
update(modified_transactions)
Updates the modified transactions in YNAB
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
Repos
repos.CategoryRepo
Repository which holds all categories from your YNAB budget
| Attributes: |
|
|---|
fetch_all()
Fetches all Categories from YNAB budget
| Returns: |
|
|---|
fetch_by_id(category_id)
Fetches a YNAB category by its ID
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
fetch_by_name(category_name, group_name=None)
Fetches a YNAB category by its name
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
repos.PayeeRepo
Repository which holds all payees from your YNAB budget
| Attributes: |
|
|---|
fetch_all()
Fetches all payees from YNAB budget
| Returns: |
|
|---|
fetch_by_id(payee_id)
Fetches a payee by its ID
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
fetch_by_name(payee_name)
Fetches a payee by its name
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
fetch_by_transfer_account_id(transfer_account_id)
Fetches a transfer payee by the target account id
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
repos.AccountRepo
Repository which holds all accounts from your YNAB budget
fetch_all()
Fetches all accounts from YNAB budget
| Returns: |
|
|---|
fetch_by_id(account_id)
Fetches a YNAB account by its ID
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
fetch_by_name(account_name)
Fetches a YNAB account by its name
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
Models
models.Credentials
dataclass
Credentials to use for YNAB
| Attributes: |
|
|---|
models.Transaction
dataclass
Represents original transaction from YNAB
| Attributes: |
|
|---|
models.SubTransaction
dataclass
Represents an YNAB Subtransaction as part of an existing split transaction
| Attributes: |
|
|---|
models.Modifier
Bases: BaseModel
Transaction object prefilled with values from original transaction which can take modified values
| Attributes: |
|
|---|
models.ModifierSubTransaction
Bases: BaseModel
YNAB Subtransaction object for creating split transactions. To be used as element in subtransaction attribute of Transaction class
| Attributes: |
|
|---|
models.ModifiedTransaction
Bases: BaseModel
changed_attributes: dict
property
Returns a dictionary representation of the modified values and the original transaction
as_dict()
Returns a dictionary representation of the transaction which is used for the update call to YNAB
is_changed()
Helper function to determine if transaction has been altered as compared to original one
| Returns: |
|
|---|
models.Category
Bases: BaseModel
Category object of YNAB budget
| Attributes: |
|
|---|
models.Payee
Bases: BaseModel
Represents a YNAB Payee
| Attributes: |
|
|---|
models.Account
dataclass
Account object from YNAB
| Attributes: |
|
|---|
Exceptions
exceptions.AdjustError
Bases: Exception
Raised when an error occurs while running the factory on a transaction or during validation of the returned results of the run
exceptions.NoMatchingCategoryError
Bases: Exception
Raised when no matching category is found in the specified budget
exceptions.MultipleMatchingCategoriesError
Bases: Exception
Raised when multiple matching categories are found in the specified budget. This can be the case when categories have the same name under different category groups
exceptions.NoMatchingPayeeError
Bases: Exception
Raised when no matching payee is found in the specified budget
exceptions.NoMatchingAccountError
Bases: Exception
Raised when no matching account is found in the specified budget
exceptions.ExistingSubTransactionError
Bases: Exception
Raised when subtransactions are specified in the modifier for a transaction which already has subtransactions. YNAB currently doesn't allow updating splits of existing split transactions via the API