No project description provided
Project description
Economic agent-based models with financial accounting
abcFinance (short for 'agent-based computational Finance') provides tools for using standard double-entry bookkeeping methods either directly or within an agent-based modelling framework. It is a sister library to the abcEconomics (agent-based computational Economics) library.
Direct use of double-entry bookkeeping tools
The Ledger
class implements an accounting system. Booking statements are recorded through the book()
method. The basic syntax works as follows:
accountingsystem = Ledger()
accountingsystem.make_stock_accounts('Assets', 'Liabilities')
accountingsystem.book(debit=[('Assets',100)], credit=[('Liabilities',100)]
where debit
and credit
are lists of tuples ('account', amount)
of accounts that should be booked by amount
on the debit and credit side, respectively. The total sum of debits and credits needs to be equal in one booking statement. Accounts have to be declared as either stock or flow accounts before they can be booked.
The balance sheet is composed of all stock accounts and includes an equity account whose name can be set using the optional residual_account_name
flag in the constructor of Ledger
. The profit and loss statement is composed of all flow accounts. It can be viewed using the print_profit_and_loss()
statement. The profit or loss for the period can be booked against equity using the book_end_of_period()
method, which also resets all flow accounts. The balance sheet can be printed using the print_balance_sheet()
method. draw_balance_sheet()
returns the string representation of an SVG image of the balance sheet. Several other helpful methods are available.
Extensive examples can be found in the examples\money_creation
folder.
Use in an agent-based modelling system
The Ledger
class can be used as an attribute for an Agent
class in an agent-based modelling system, enabling the use of financial accounting within agent-based models. One implementation is provided in the form of the AbcFinanceAgent
class, which inherits from the Agent
class in the abcEconomics library. abcEconomics is designed to be compatible with abcFinance and provides several methods to facilitate the use of abcFinance methods in agent-based models. The accounting system provided in abcFinance can in principle be used with any agent-based modelling system.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file abcFinance-0.1.1.tar.gz
.
File metadata
- Download URL: abcFinance-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0184c61de1dcf0234eed972ca8faf8aa806178bce62ea304157e323084a1e80 |
|
MD5 | 90f0d2db469e0e834c607e2e870f230f |
|
BLAKE2b-256 | 5d0f50d2c0948ebcd504da3f49223e7aebddec730b9a2fbf6bfaeff1de4ff760 |
File details
Details for the file abcFinance-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: abcFinance-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb3d03838ab491159e7d06e0684ee9f4a5cded465f004ef8503b5631f4027562 |
|
MD5 | e5e11bb78ea993a77fee0bff07a83064 |
|
BLAKE2b-256 | 1f23c02d4d04140c1199b4ea3e7d83ccb47a480bad3ab6bc26e38f6159f03f54 |