-
Notifications
You must be signed in to change notification settings - Fork 2
Account
Documentation > Account
An Account is collection of related economic activity. For example, an Account might represent a bank account, income from a particular client, or entity equity. Many Accounts together compose an Entity.
Accounts themselves are composed of Transactions, and the sum of constituent transactions yield an Account Balance.
The Accounts that compose an Entity may be viewed together as part of the Tree.
An identifier for this account, unique within an Entity. Note the trailing underscore, necessary to prevent clobbering of Python's inbuilt id property.
Example: 42
.session - Session
The Session used to initialise this Account
.entity - Entity
The Entity of which this Account is a member
A friendly name for this Account
Example: "Subscription revenue"
.am_type - Type
The Amatino type of the Account, one of .asset, .liability, .income, .expense or .equity
Example: Type.income
The identifier of this Account's parent, if there is one
Example: 154
The parent of this Account, if it has one
The identifier of this Account's denominating Global Unit, or none if this Account is denominated by a Custom Unit
Example: 5
The identifier of this Account's denominating Custom Unit, or none if this Account is denominated by a Global Unit
Example: none
The denominating unit of this Account, either a GlobalUnit or a CustomUnit.
Example: See Denomination
The identifier of an Entity identified as a counter-party to this Account, if any
Example: None
Friendly description of this Account
Example: "Sweet loot from accounting API subscriptions"
.color - Color
Hex colour value associated with this Account, stored in an instance of Color
Example: See Color
Create a new Account
- entity: Entity
- name: str
- am_type: AMType
- denomination: Denomination
- description: Optional[str]
- parent: Optional[Account]
- counter_party: Optional[Entity]
- color: Optional[Color]
cash_on_hand = Account.create(
entity=mega_corp,
description='Cash on hand',
am_type=AMType.asset,
denomination=USD
)Retrieve an existing Account.
- entity: Entity
- account_id: int
cash_on_hand = Account.retrieve(
entity=mega_corp,
account_id=42
)Update this Account with new metadata. NB: The Account instance is not updated in place. A new instance of Account is returned, containing the prescribed changes.
All parameters are optional. Any parameter that you do not provide will be assigned the existing Account value.
- name: Optional[str]
- am_type: Optional[AMType]
- parent: Optional[Account]
- description: Optional[str]
- denomination: Optional[Denomination]
- counterparty: Optional[Entity]
- color: Optional[Color]
updated_account = cash_on_hand.update(
description='An updated, Mk 2.0, revised, epic description'
)Not yet implemented.