Metadata-Version: 2.4
Name: piecash
Version: 1.3.0
Summary: A pythonic interface to GnuCash SQL documents.
Home-page: https://github.com/gorf/piecash-community
Author: sdementen
Author-email: sdementen@gmail.com
Maintainer: sdementen
Maintainer-email: sdementen@gmail.com
License: MIT
Keywords: GnuCash,python,binding,interface,sqlalchemy
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Software Development :: Libraries :: Python Modules
License-File: LICENSE
Requires-Dist: SQLAlchemy>=1.4
Requires-Dist: SQLAlchemy-Utils!=0.36.8
Requires-Dist: pytz
Requires-Dist: tzlocal
Requires-Dist: click
Provides-Extra: postgres
Requires-Dist: psycopg2-binary; extra == "postgres"
Requires-Dist: psycopg[binary]; extra == "postgres"
Provides-Extra: mysql
Requires-Dist: PyMySQL[rsa]; extra == "mysql"
Provides-Extra: ledger
Requires-Dist: money; extra == "ledger"
Requires-Dist: babel; extra == "ledger"
Provides-Extra: pandas
Requires-Dist: pandas; extra == "pandas"
Provides-Extra: qif
Requires-Dist: qifparse; extra == "qif"
Provides-Extra: yahoo
Requires-Dist: requests; extra == "yahoo"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: tox; extra == "test"
Requires-Dist: flake8; extra == "test"
Requires-Dist: psycopg2-binary; extra == "test"
Requires-Dist: psycopg[binary]; extra == "test"
Requires-Dist: PyMySQL[rsa]; extra == "test"
Requires-Dist: pandas; extra == "test"
Requires-Dist: requests; extra == "test"
Requires-Dist: money; extra == "test"
Requires-Dist: babel; extra == "test"
Provides-Extra: doc
Requires-Dist: sphinx; extra == "doc"
Requires-Dist: sphinxcontrib-programoutput; extra == "doc"
Requires-Dist: sphinx-autobuild; extra == "doc"
Requires-Dist: sphinx-rtd-theme; extra == "doc"
Requires-Dist: ipython; extra == "doc"
Requires-Dist: psycopg2-binary; extra == "doc"
Requires-Dist: psycopg[binary]; extra == "doc"
Requires-Dist: PyMySQL[rsa]; extra == "doc"
Requires-Dist: pandas; extra == "doc"
Requires-Dist: requests; extra == "doc"
Requires-Dist: money; extra == "doc"
Requires-Dist: babel; extra == "doc"
Provides-Extra: all
Requires-Dist: psycopg2-binary; extra == "all"
Requires-Dist: psycopg[binary]; extra == "all"
Requires-Dist: PyMySQL[rsa]; extra == "all"
Requires-Dist: pandas; extra == "all"
Requires-Dist: requests; extra == "all"
Requires-Dist: money; extra == "all"
Requires-Dist: babel; extra == "all"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: platform
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: summary

piecash
=======

.. note::
   **Maintenance**: This is a community-maintained fork of piecash. It will continue to receive bug fixes and compatibility updates.
   The original project has limited maintenance. Issues and PRs are welcome. `Original repo <https://github.com/sdementen/piecash>`__

   **v1.3.0**: SQLAlchemy >= 1.4 (no upper cap; 2.0/2.1 compatible), locale currency, invoices, historical account balances,
   ledger/balance fixes, PostgreSQL/MySQL test teardown, and CI for Python 3.8–3.12.

.. image:: https://github.com/gorf/piecash-community/actions/workflows/github-actions.yml/badge.svg
    :target: https://github.com/gorf/piecash-community/actions

.. image:: https://readthedocs.org/projects/piecash/badge/?version=master
    :target: http://piecash.readthedocs.org

.. image:: https://img.shields.io/pypi/v/piecash.svg
    :target: https://pypi.python.org/pypi/piecash

.. image:: https://img.shields.io/pypi/pyversions/piecash.svg
    :target: https://pypi.python.org/pypi/piecash/

.. image:: https://img.shields.io/pypi/dd/piecash.svg
    :target: https://pypi.python.org/pypi/piecash/


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

:Documentation: http://piecash.readthedocs.org.
:Github: https://github.com/gorf/piecash-community
:PyPI: https://pypi.python.org/pypi/piecash


It is a pure python package, tested on python 3.8 to 3.12, 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:

- export to ledger-cli format (http://www.ledger-cli.org/)
- export to QIF format
- import/export prices (CSV format)

A simple example of a piecash script:

.. code-block:: python

    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:
                print(sp.transaction.description)

The project has reached beta stage.

.. important::

   If you want to work with python 2.7/3.4 and books from gnucash 2.6.x series, you can use piecash 0.19.0.
   Versions of piecash as of 1.0.0 support books from gnucash 3.0.x series.
   Current releases target python 3.8+ (CI covers 3.8–3.12) and require SQLAlchemy >= 1.4.

.. warning::

   1) Always do a backup of your gnucash file/DB before using piecash.
   2) Test first your script by opening your file in readonly mode (which is the default mode)


