Skip to content

Recursive Balance

Hugh Jeremy edited this page Apr 23, 2019 · 3 revisions

Documentation > Recursive Balance

A Recursive Balance represents the sum total value of all Entries party to an Account, and all of that Account's children.

Properties

.session - Session

The Session used to initialise this RecursiveBalance


.entity - Entity

The Entity to which the Account described by this RecursiveBalance belongs.


.time - datetime

The time at which this RecursiveBalance holds. Transactions before this time are included, and those after are excluded.

Example: datetime.datetime(2019, 1, 18, 21, 4, 43, 557821)


.account - Account

The Account that this RecursiveBalance describes. Retrieving the .account property causes a new synchronous call to the API, the RecursiveBalance object only stores a reference to the Account ID (the .account_id property), not the whole Account object.


.account_id - int

The integer ID of the Account that this Balance describes.

Example: 42


.denomination - Denomation

The denominating unit of this RecursiveBalance, either a GlobalUnit or a CustomUnit. Retrieving the .denomination property will cause a synchronous call to the API.


.is_recursive - bool

An assertion that this is a RecursiveBalance.

Example: True


.generated_time - datetime

The time at which this RecursiveBalance object was generated.

Example: datetime.datetime(2019, 1, 18, 21, 4, 43, 557821)


.global_unit_id - Optional[int]

The integer identifier of the GlobalUnit denominating this RecursiveBalance, if any.

Example: 5


.custom_unit_id - Optional[int]

The integer identifier of the CustomUnit denominating this RecursiveBalance, if any.

Example: None

Methods

classmethod .retrieve() -> RecursiveBalance

Return a new RecursiveBalance instance.

Parameters

  1. entity - Entity
  2. account - Account
  3. balance_time - Optional[datetime]
  4. denomination - Optional[Denomination]

Example

recursive_balance = RecursiveBalance.retrieve(
  entity=mega_corp,
  account=cash_account
)
print(recursive_balance.magnitude)

Clone this wiki locally