-
Notifications
You must be signed in to change notification settings - Fork 2
Tree
Documentation > Tree
Trees present the entire chart of Accounts of an Entity in a single hierarchical object.
Each Account is nested under its parent, and in turn lists all its children, all providing Balances and Recursive Balances.
Trees are trimmed for permissions. If the user requesting the tree only has read access to a subset of Accounts, they will only receive a tree containing those accounts, with placeholder objects filling the place of Accounts they are not permitted to read.
Each Account in the Tree is presented as a Tree Node.
.session - Session
The Session used to initialise this Tree
.entity - Entity
The Entity to which the Accounts described by this Tree belong.
The time at which the balances in this Tree hold.
Example: datetime.datetime(2019, 1, 18, 21, 4, 43, 557821)
The time at which this Tree 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)
.denomination - Denomination
The denominating unit of this Tree, either a GlobalUnit or a CustomUnit. Accessing the .denomination property will cause a synchronous call to the API. Successive accesses will return cached data.
The integer identifier of the GlobalUnit that denominates this Tree, or None if this Tree is denominated in a CustomUnit.
Example: 5
The integer identifier of the CustomUnit that denominates this Tree, or None if this Tree is denominated in a GlobalUnit.
Example: None
.tree - List[TreeNode]
A list of TreeNode objects, each representing a top-level Account node in the hierarchy of Accounts this Tree describes. If the Entity in question has no accounts, this list will be empty.
Example: See TreeNode
True if this Tree has at least one TreeNode in the .tree property.
Example: True
.assets - List[TreeNode]
A list of TreeNode objects, each representing a top-level asset Account node in the hierarchy of Accounts this Tree describes. If the Entity in question has no asset accounts, this list will be empty.
Example: See TreeNode
True if this Tree 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 Tree describes. If the Entity in question has no liability accounts, this list will be empty.
Example: See TreeNode
True if this Tree has at least one liability TreeNode in the .liability 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 Tree describes. If the Entity in question has no equity accounts, this list will be empty.
Example: See TreeNode
True if this Tree has at least one equity TreeNode in the .equity property.
Example: False
.expenses - List[TreeNode]
A list of TreeNode objects, each representing a top-level expense Account node in the hierarchy of Accounts this Tree describes. If the Entity in question has no expense accounts, this list will be empty.
Example: See TreeNode
True if this Tree has at least one equity TreeNode in the .expenses property.
Example: False
.income - List[TreeNode]
A list of TreeNode objects, each representing a top-level income Account node in the hierarchy of Accounts this Tree describes. If the Entity in question has no income accounts, this list will be empty.
Example: See TreeNode
True if this Tree has at least one income TreeNode in the .income property.
Example: True
The sum of the recursive balances of all top-level asset accounts in this Tree.
The sum of the recursive balances of all top-level expense accounts in this Tree.
The sum of the recursive balances of all top-level liability accounts in this Tree.
The sum of the recursive balances of all top-level income accounts in this Tree.
The sum of the recursive balances of all top-level equity accounts in this Tree.
Return the top level Tree Nodes in this Tree having the supplied Amatino Type.
- am_type: AMType
Return a new Tree instance.
- entity - Entity
- balance_time - datetime
- denomination - Denomination
tree = Tree.retrieve(
entity=mega_corp,
balance_time=datetime.utcnow()
denomination=USD
)