Skip to content

Position

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

Documentation > Position

Positions are hierarchical collections of Account balances describing the financial position of an [Entity](Entity_ at a point in time. They are generic representations of popular accounting constructs better known as a 'Balance Sheet', 'Statement of Financial Position', or 'Statements of Assets, Liabilities and Owner's Equity

Positions are jurisdiction agnostic, and obey simple double-entry accounting rules. They list asset, liability, and equity Accounts, each nesting its own children.

You can retrieve Positions denominated in arbitrary GlobalUnit or CustomUnit. When a particular denomination gives rise to an unrealised gain or loss, Amatino will automatically calculate that gain or loss and include it as a top-level account in the returned Position.

Positions may also be retrieved to an arbitrary depth. Depth in the Position context is the number of levels down the Account hierarchy Amatino should go when retrieving the Position. 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 for all Accounts at full depth.

Properties

.session - Session

The Session used to initialise this Position


.entity - Entity

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


.balance_time - datetime

The time at which the balances in this Position hold.

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


.generated_time - datetime

The time at which this Position 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 Position 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 Position, 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 Position, or None if this Position is denominated in a CustomUnit.

Example: 5


.custom_unit_id - Optional[int]

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

Example: None


.assets - List[TreeNode]

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

Example: See TreeNode


.has_assets - bool

True if this Position has at least one asset TreeNode in the .asset property.

Example: True


.liabilities - List[TreeNode]

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

Example: See TreeNode


.has_liabilities - bool

True if this Position has at least one liability TreeNode in the .expenses property.

Example: False


.equities - List[TreeNode]

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

Example: See TreeNode


.has_equities - bool

True if this Position has at least one equity TreeNode in the .equity property.

Example: False


.total_liabilities - Decimal

The sum of the recursive balances of all top-level liability accounts in this Position.


.total_equity - Decimal

The sum of the recursive balances of all top-level equity accounts in this Position.


.total_assets - Decimal

The sum of the recursive balances of all top-level asset accounts in this Position


Methods

classmethod .retrieve() -> Position

Return a new Position instance.

Parameters

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

Example

balance_sheet = Position.retrieve(
  entity=mega_corp,
  balance_time=datetime.utcnow()
  denomination=USD
)
You can’t perform that action at this time.