Skip to main content

A pythonic interface to GnuCash SQL documents.

Project description

piecash offers a pythonic interface to GnuCash documents stored through the SQL backend (sqlite, postgres).

A simple example:

from piecash import open_book

# open a book and print all transactions to screen
with open_book("test_cur.gnucash") as s:
    for tr in s.transactions:
        print("Transaction : {}".format(tr.description))
        for i, sp in enumerate(tr.splits):
            direction = "increased" if sp.value > 0 else "decreased"
            print("\t{} : '{}' is {} by {}".format(i,
                                                   sp.account.fullname,
                                                   direction,
                                                   sp.value))

from piecash import create_book, Account
# create a new account
with create_book("my_new_book.gnucash") as s:
    acc = Account(name="Income", parent=s.book.root_account, account_type="INCOME")
    s.save()

The project documentation is available on http://piecash.readthedocs.org/en/latest/.

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

piecash-0.3.1.tar.gz (417.4 kB view hashes)

Uploaded Source

Supported by

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