Skip to main content

A minimal yet valid double-entry accounting system in Python.

Project description

abacus

pytest PyPI

A minimal yet valid double-entry accounting system in Python.

Documentation

See project documentation at https://epogrebnyak.github.io/abacus/.

Installation

pip install abacus-py

For latest version install from github:

pip install git+https://github.com/epogrebnyak/abacus.git

abacus-py requires Python 3.10 or higher.

Quick example

Let's do Sample Transaction #1 from accountingcoach.com[^1].

[^1]: It is a great learning resource for accounting, highly recommended.

On December 1, 2022 Joe starts his business Direct Delivery, Inc. The first transaction that Joe will record for his company is his personal investment of $20,000 in exchange for 5,000 shares of Direct Delivery's common stock. Direct Delivery's accounting system will show an increase in its account Cash from zero to $20,000, and an increase in its stockholders' equity account Common Stock by $20,000.

Solution

Both Python code and command line script below will produce balance sheet after Sample Transaction #1 is completed.

Python code:

from abacus import Chart, Report

chart = Chart(assets=["cash"], capital=["common_stock"])
ledger = chart.ledger()
ledger.post(debit="cash", credit="common_stock", amount=20000, title="Owner's investment")
report = Report(chart, ledger)
print(report.balance_sheet)

Command line script:

bx init
bx post --entry asset:cash capital:common_stock 20000 --title "Initial investment"
bx report --balance-sheet

Result

Balance sheet
ASSETS  20000  CAPITAL              20000
  Cash  20000    Common stock       20000
                 Retained earnings      0
               LIABILITIES              0
TOTAL   20000  TOTAL                20000

See further transactions for this example at documentation website.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abacus_py-0.8.7.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abacus_py-0.8.7-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file abacus_py-0.8.7.tar.gz.

File metadata

  • Download URL: abacus_py-0.8.7.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.8 Linux/6.2.0-1018-azure

File hashes

Hashes for abacus_py-0.8.7.tar.gz
Algorithm Hash digest
SHA256 08a5a5e8448bbe2722601d6cd63f370bfbb7f6638e6697a9a22fb1889b1da092
MD5 645702cb2008e7317f6975a3ce5880c6
BLAKE2b-256 071fb88c52275af3c7f245c6c6ab5063c1174350b316b101776b6c11a2784599

See more details on using hashes here.

File details

Details for the file abacus_py-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: abacus_py-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.8 Linux/6.2.0-1018-azure

File hashes

Hashes for abacus_py-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e85b93f1607e33133687fbe90ae37c3eac66a199de33f8316d29b7caa2d4393f
MD5 ef252cabde60d25cf280280955debc72
BLAKE2b-256 85615baf6746120fe998fb74f375c6296b5a64a7974932f7e48d61b8bc32e93a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page