Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sdementen/piecash
Pythonic interface to GnuCash SQL documents
https://github.com/sdementen/piecash
bindings finance gnucash piecash python
Last synced: about 1 month ago
JSON representation
Pythonic interface to GnuCash SQL documents
- Host: GitHub
- URL: https://github.com/sdementen/piecash
- Owner: sdementen
- License: other
- Created: 2014-11-11T13:27:51.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T21:00:09.000Z (3 months ago)
- Last Synced: 2024-10-02T16:12:10.127Z (2 months ago)
- Topics: bindings, finance, gnucash, piecash, python
- Language: Python
- Homepage:
- Size: 4.93 MB
- Stars: 287
- Watchers: 25
- Forks: 75
- Open Issues: 31
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - sdementen/piecash - Pythonic interface to GnuCash SQL documents (python)
README
piecash
=======.. image:: https://badges.gitter.im/sdementen/piecash.svg
:alt: Join the chat at https://gitter.im/sdementen/piecash
:target: https://gitter.im/sdementen/piecash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge.. image:: https://github.com/sdementen/piecash/workflows/CI/badge.svg
:target: https://github.com/sdementen/piecash/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/.. image:: https://coveralls.io/repos/sdementen/piecash/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/sdementen/piecash?branch=masterPiecash provides a simple and pythonic interface to GnuCash files stored in SQL (sqlite3, Postgres and MySQL).
:Documentation: http://piecash.readthedocs.org.
:Gitter: https://gitter.im/sdementen/piecash
:Github: https://github.com/sdementen/piecash
:PyPI: https://pypi.python.org/pypi/piecashIt 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 scratchScripts 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# 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 supports python >=3.6 and books from gnucash 3.0.x series... 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)