Skip to main content

A pythonic interface to GnuCash SQL documents.

Project description

Join the chat at

Piecash provides a simple and pythonic interface to GnuCash files stored in SQL (sqlite3, Postgres and MySQL).





It is a pure python package, tested on python 3.6 to 3.9, that can be used as an alternative to:

  • the official python bindings (as long as no advanced book modifications and/or engine calculations are needed). This is specially useful on Windows where the official python bindings may be tricky to install or if you want to work with python 3.

  • XML parsing/reading of XML GnuCash files if you prefer python over XML/XLST manipulations.

piecash test suite runs successfully on Windows and Linux on the three supported SQL backends (sqlite3, Postgres and MySQL). piecash has also been successfully run on Android (sqlite3 backend) thanks to Kivy buildozer and python-for-android.

It allows you to:

  • open existing GnuCash documents and access all objects within

  • modify objects or add new objects (accounts, transactions, prices, …)

  • create new GnuCash documents from scratch

Scripts are also available to:

A simple example of a piecash script:

with open_book("example.gnucash") as book:
    # get default currency of book
    print( book.default_currency )  # ==> Commodity<CURRENCY:EUR>

    # iterating over all splits in all books and print the transaction description:
    for acc in book.accounts:
        for sp in acc.splits:

The project has reached beta stage.

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-1.2.0.tar.gz (1.2 MB 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