Skip to content

Performance

Hugh Jeremy edited this page Mar 20, 2019 · 3 revisions

Documentation > Performance

A Performance is a hierarchical collection of Account balances describing the financial performance of an Entity over a period of time. They are generic representations of popular accounting constructs known as the 'Income Statement', 'Profit & Loss', or 'Statement of Financial Performance'.

The Peformance object is jurisdiction agnostic, and obeys simple double-entry accounting rules. They list income and expense, each nesting its own children.

You can retrieve a Performance denominated in an arbitrary Global Unit or Custom Unit. Amatino will automatically calculate the implicit gain or loss relative to each Account's underlying denomination and include those gains and losses in each Account balance.

A Performance may be retrieved to an arbitrary depth. Depth in the Performance context is the number of levels down the Account hierarchy Amatino should go when retrieving the Performance. For example, if a top-level Account has child accounts three layers deep, then specifying a depth of three will retrieve all those children.

Regardless of the depth you specify, Amatino will calculate recursive balances at full depth.

Properties

.session - Session

The Session used to initialise this Performance


.entity - Entity

The Entity to which the Accounts described by this Performance belong.


.start_time - datetime

The time at which the window this Performance observes begin. Transactions before this time are excluded.

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


.end_time - datetime

The time at which the window this Performance observes ends. Transactions after this time are excluded.

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


.generated_time - datetime

The time at which this Performance was generated by the Amatino API. Transactions and other data created after this time are excluded.

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


.depth - int

The integer number of recursive layers to which this Performance reaches. For example, if an Account has five layers of recursive children, and you request retrieval to a depth of 3, you will receive the first three layers and .depth will be 3.

Example: 3


.denomination - Denomination

The denominating unit of this Performance, either a GlobalUnit or a CustomUnit. Accessing the .denomination property will cause a synchronous call to the API. Successive accesses will return cached data.


.global_unit_id - Optional[int]

The integer identifier of the GlobalUnit that denominates this Performance, or None if this Performance is denominated in a CustomUnit.

Example: 5


.custom_unit_id - Optional[int]

The integer identifier of the CustomUnit that denominates this Performance, or None if this Performance is denominated in a GlobalUnit.

Example: None


.income - List[TreeNode]

A list of TreeNode objects, each representing a top-level income Account node in the hierarchy of Accounts this Performance describes. If the Entity in question has no income accounts, this list will be empty.

Example: See TreeNode


.has_income - bool

True if this Performance has at least one income account in the .income property.

Example: True


.expenses - List[TreeNode]

A list of TreeNode objects, each representing a top-level expense Account node in the hierarchy of Accounts this Performance describes. If the Entity in question has no expense accounts, this list will be empty.

Example: See TreeNode


.has_expenses - bool

True if this Performance has at least one expense account in the .expenses property.

Example: False

.total_expenses - Decimal

The sum of the recursive balances of all top-level expense accounts in this Performance.


.total_income - Decimal

The sum of the recursive balances of all top-level income accounts in this Performance.


Methods

classmethod .retrieve() -> Performance

Return a new Performance instance.

Parameters

  1. entity - Entity
  2. start_time - datetime
  3. end_time - datetime
  4. denomination - Denomination
  5. depth - Optional[int]

Example

performance = Performance.retrieve(
  entity=mega_corp,
  start_time=(datetime.utcnow() - timedelta(days=365))
  end_time=datetime.utcnow()
  denomination=USD
)
You can’t perform that action at this time.