{"id":15024945,"url":"https://github.com/joshuabach/gnucash-web","last_synced_at":"2025-03-31T09:04:30.948Z","repository":{"id":41904342,"uuid":"436082503","full_name":"joshuabach/gnucash-web","owner":"joshuabach","description":"A simple, mobile-friendly webinterface for GnuCash","archived":false,"fork":false,"pushed_at":"2024-05-16T21:43:39.000Z","size":1854,"stargazers_count":134,"open_issues_count":34,"forks_count":24,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-22T20:48:57.563Z","etag":null,"topics":["app","bootstrap","flask","gnucash","mobile","python","web"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshuabach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-08T01:49:50.000Z","updated_at":"2025-03-15T00:00:44.000Z","dependencies_parsed_at":"2024-10-30T03:20:42.306Z","dependency_job_id":null,"html_url":"https://github.com/joshuabach/gnucash-web","commit_stats":{"total_commits":95,"total_committers":1,"mean_commits":95.0,"dds":0.0,"last_synced_commit":"085a63dc9ce5d772a081f8936392567576718105"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuabach%2Fgnucash-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuabach%2Fgnucash-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuabach%2Fgnucash-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuabach%2Fgnucash-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshuabach","download_url":"https://codeload.github.com/joshuabach/gnucash-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443536,"owners_count":20778248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","bootstrap","flask","gnucash","mobile","python","web"],"created_at":"2024-09-24T20:01:15.409Z","updated_at":"2025-03-31T09:04:30.919Z","avatar_url":"https://github.com/joshuabach.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"GnuCash Web\n===========\n\n*GnuCash Web* is a simple, easy to use, mobile-friendly web interface for\n[GnuCash](https://gnucash.org/) intended for self-hosting. It can access a single\nGnuCash-Database in [sqlite3](https://sqlite.org/index.html),\n[postgres](https://www.postgresql.org/) or [mysql](https://www.mysql.com/de/) (including\n[mariadb](https://mariadb.org/)) format using the great\n[piecash](https://pypi.org/project/piecash/) GnuCash library for Python.\n\nDevelopment status should be considered at most *Beta*, see [below](#Contributing) for\nmore information.\n\nCheck out the [demo](https://gnucash-web-demo.bachmeier.cc)!\n\nFeatures\n--------\n\nThe primary use case for *GnuCash Web* is adding simple two-split transactions on the\ngo, e.g. to record a cash expense when buying a coffee.\n\nKey features include:\n\n- Browse account hierarchy\n- View transaction history and balance for an account\n- Add and edit two-split transactions, delete transactions\n- Recycle commonly used transactions\n- Simple single-user authentication\n- Ease of use, especially on mobile\n- CLI to update the price database\n\n| Browse account hierarchy                                                  | View and add transactions                                                    | Edit transactions                                                                    |\n|---------------------------------------------------------------------------|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| ![Browse account hierarchy](/screenshots/book.accounts.list.png?raw=true) | ![View and add transactions](/screenshots/book.accounts.ledger.png?raw=true) | ![Edit transaction](/screenshots/book.accounts.ledger.transaction-edit.png?raw=true) |\n\nCore Technology Stack\n---------------------\n\n- [Python](https://www.python.org/)\n- [piecash](https://pypi.org/project/piecash/) for accessing GnuCash database\n- [Flask](https://palletsprojects.com/p/flask/) web framework\n- [Bootstrap](https://getbootstrap.com/) for front end design\n\nInstallation\n------------\n\n*GnuCash Web* is [available on PyPI](https://pypi.org/project/GnuCash-Web/), so you can\nsimply install it via `pip install gnucash_web`. Additionally, you may need to install\n`mysql` or `psycopg2`, depending on which back end you want to use (sqlite back end is\nincluded in the python standard library).\n\nNote that at least Python 3.8 is required.\n\nYou also need to setup a database that stores the GnuCash data, see\n[below](#initialising-database) for more information. Mind that you will likely need\nto be able to access the database directly from your desktop/notebook with the\nofficial GnuCash desktop app, since *GnuCash Web* is only a companion and not\nintended to be used on its own. If your database is not publicly accessible, using an\n[SSH Tunnel](https://www.ssh.com/academy/ssh/tunneling) is an easy and secure way to\naccess it remotely.\n\nUsage\n-----\n\n*GnuCash Web* is aimed at system administrators, but is otherwise easy to set up.\n\n### Configuration\n\nCreate a config file in `/etc/gnucash-web/config.py` or in\n`~/.config/gnucash-web/config.py`.  If both files are present, values from the latter\noverride those from the former.  Set the environment variable `GNUCASH_WEB_CONFIG` to load\na different config file. If set, no other config files are read.\n\nConfig variables can also be set via environment variables, with the same available options.\n\nThe config file is a python script. The following example illustrates possible values for\nall available options. This is the normal Flask configuration file, so all [standard\nconfiguration\nvariables](https://flask.palletsprojects.com/en/2.0.x/config/#builtin-configuration-values)\ncan also be set. All options have [default values](gnucash_web/config/default.py), but you \nshould at least set `SECRET_KEY` and `DB_NAME`.\n\n```python\nimport logging\n\n# A 32-bit-key used e.g. to encrypt the session cookie or for other cryptographic operations\n# Use e.g. `from Crypto.Random import get_random_bytes; print(get_random_bytes(32))`\nSECRET_KEY = 'please use something thats actually safe'\n\n# Python standard library log level\nLOG_LEVEL = logging.WARN\n\n# Supported values: 'sqlite', 'mysql' or 'postgres'\nDB_DRIVER = 'mysql'\n\n# Host name of the database (ignored for DB_DRIVER = 'sqlite')\nDB_HOST = 'database.example.org'\n\n# Name of the Database on the host (for DB_DRIVER = 'sqlite', this is the 'path/to/db.sqlite')\nDB_NAME = 'gnucash_data'\n\n# Supported values: None, 'passthrough'. See below for details.\nAUTH_MECHANISM = None\n\n# The maximum number of transactions per page in the ledger\nTRANSACTION_PAGE_LENGTH = 25\n\n# Name of the account to be preselected when creating new transactions (optional)\nPRESELECTED_CONTRA_ACCOUNT = 'Example:Account'\n```\n\n### Running\n\nIt is not recommended to use the builtin Flask web server in production. *GnuCash Web*\ncomes as a [WSGI](https://wsgi.readthedocs.io/en/latest/) application, so there are [many\noptions](https://flask.palletsprojects.com/en/2.0.x/deploying/) available to run it.\n\nMost WSGI web server require setting a \"module\", which is the WSGI object that runs the\napp. For *GnuCash Web*, this is `gnucash_web.wsgi:app`.\n\nFor example, the following `.ini`-file might be used as a config for\n[uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/):\n\n```ini\n[uwsgi]\nmodule = gnucash_web.wsgi:app\npidfile = gnucash_web.pid\nmaster = true\nprocesses = 1\nhttp-socket = :8080\nchmod-socket = 660\nvacuum = true\n```\n\n#### Docker\n\n*GnuCash Web* can be run using [Docker](https://www.docker.com/), either using the published \n[packages](https://github.com/joshuabach/gnucash-web/packages), DockerFile, or using [docker compose](https://docs.docker.com/compose/) \nwith the provided sample `docker-compose.yml` files. This uses a simple SQLite backend, \nthough if you want to use a dedicated database backend then `docker-compose-postgres.yml`\nis also provided, running [PostgreSQL](https://www.postgresql.org/) as the name implies.\n\nIn either case, configuration is done via environment variables in the compose file instead\nof the default configuration file. The same options are available.\n\nIf you're running a dedicated backend as part of docker compose, then in order to \n[initialise the database](#initialising-database) you'll need to \n[expose the respective ports](https://docs.docker.com/compose/networking/).\nKeep security in mind when exposing ports, such as using a strong password,\nas exposing ports may grant any user on the internet access to your database.\n\nIf you want to quickly spin up and test gnucash-web, then a sample GnuCash database is \n[provided](sample/sample.sqlite) for the SQLite version.\n\nThe Docker version runs the [gunicorn](https://gunicorn.org/) WSGI server.\n\n### Initialising database\n\n*GnuCash Web* only works on a preexisting database. It is also currently not possible\nto create accounts. Therefore, you have to create a database and populate it with an\naccount hierarchy before you can use *GnuCash Web*.\n\nPreferably, you will use the official GnuCash desktop app to create a new\nbook. Simply select the appropriate database back end in the *Open*-dialog. You can\nalso migrate an existing GnuCash XML file to a database using *Save as*. More details\nand database considerations can be found in the official [GnuCash\ndocumentation](https://www.gnucash.org/docs/v4/C/gnucash-guide/basics-files1.html).\n\nAlternatively, you can also use *piecash* to create a new book, as is described in\ntheir [example\nsection](https://piecash.readthedocs.io/en/master/tutorial/examples.html#creating-and-opening-gnucash-files).\n\n### Authentication\n\nCurrently, there are only two authentication mechanisms supported, `None` and `'passthrough'`.\n\nWhen using no authentication, anyone can access the web interface and no credentials are\nprovided to the database host. This is generally only useful when using the sqlite\nback end (which does not accept credentials).\n\nWhen using pass-through authentication, *GnuCash Web* asks for username and password upon login,\nwhich are provided as credentials for the database hosts. They are also stored in an\nencrypted session cookie in the users browser. \"Logging out\" simply deletes the session\ncookie.\n\n### CLI\n\nThe CLI is called `gnucash-web` and is installed with the PyPi package. Currently, the only \nsupported subcommand is `gnucash-web commodities`:\n```sh\nUsage: gnucash-web commodities [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  list           List all used commodities.\n  update_prices  Update prices for all commodities for which it is enabled.\n```\n\nYou can [add/edit commodities using the GnuCash desktop\napp](https://www.gnucash.org/docs/v4/C/gnucash-help/tool-security-edit.html). Make sure to \nenable online quotes updating. Then, `gnucash-web commodities update_prices` will retrieve\ndaily closing prices from Yahoo Finance (Quandl for currencies). See also the [piecash\ndocumentation](https://piecash.readthedocs.io/en/master/api/piecash.core.commodity.html#piecash.core.commodity.Commodity.update_prices)\nof the underlying function.\n\nDevelopment\n-----------\n\nInitialise submodules and install dependencies:\n```sh\n    git submodule init\n    git submodule update\n    pip install -r src/requirements.txt\n```\n\nRun it:\n```sh\n    cd src/gnucash_web/\n    flask run --debug\n```\n\n\nMake new release:\n- Update version number in *src/gnucash_web/version.txt*\n- Build and upload package\n  ```sh\n      cd src/\n      python -m build\n      python -m twine upload dist/gnucash_web-$VERSION*\n  ```\n- Tag commit and create release on GitHub\n\nContributing\n------------\n\n**Development is at an early stage, but contributions are welcome.**\n\nThis is (currently) a personal project to play around with and satisfy my own everyday\nneeds and intellectual curiosity.\n\nSince *GnuCash Web* fulfills my primary use case for it, I don't expect much development\nin the near future. However, if anyone is willing to help taking this into a more\nfeature-rich direction, I am motivated to work on that, though time is naturally scarce.\n\nPlease note that my primary user is myself and any changes must be compatible with my\nuse case and workflows. I will also not accept changes or additions that I cannot\ngauarantee to maintain in the future. Simplicity is more important to me than\nfeatures, so please consider this and talk to me before spending time on big changes.\n\nSee [Issues](https://github.com/joshuabach/gnucash-web/issues) and\n[Milestones](https://github.com/joshuabach/gnucash-web/milestones) for some ideas on how\nto get started.\n\nRelated Work\n------------\nThere seem to be few other projects in the same direction:\n\n- The GnuCash mailing list(s) has a few results\n  - In 2003, [Martin asked about\n    this](https://lists.gnucash.org/pipermail/gnucash-user/2003-July/007243.html) and\n    was recommended to to use SSH+X-Forwarding to access his GnuCash database\n    remotely.\n  - In 2005, [Sachin said](https://lists.gnucash.org/pipermail/gnucash-user/2005-July/014163.html)\n    they are planning to work on a web interface, but I could find no further results.\n  - In 2012, [James\n    posted](https://lists.gnucash.org/pipermail/gnucash-user/2012-March/043762.html)\n    about his project\n    [nylen/gnucash-django](https://github.com/nylen/gnucash-django), but the last\n    commit is from 2015.\n- The [GnuCash Wiki's\n  Wishlist](https://wiki.gnucash.org/wiki/WishList#Use_through_web_browser) lists the\n  use through a web browser (as well as an iPhone-App) as \"WONTFIX\" (discussion from\n  2006/2007).\n- In 2016, mikedom722 asked on\n  [Reddit](https://www.reddit.com/r/GnuCash/comments/3zlel3/gnucash_web_interface_useful/),\n  whether anyone would be interested in a web interface (stating that he has one),\n  but did not follow up.\n- In the same thread, superman279 presents his app [Remote\n  GnuCash](https://github.com/justinhunt1223/remotegnucash), but the last commit is\n  from 2017 and the website is down.\n- The [GnuCash Wiki](https://wiki.gnucash.org/wiki/GnuCash_and_Mobile_Devices)\n  mentions two GnuCash mobile apps, one for iOS and one for Android. The one for\n  Android seems to be discontinued (last commit 2020) the one for iOS still has new\n  commits in 2022, but its purpose seems to be to export a CSV to be imported in\n  GnuCash, rather then writing to the database directly.\n- There is\n  [alensiljak/gnucash-portfolio-webui](https://github.com/alensiljak/gnucash-portfolio-webui)\n  on GitHub, but the README does not clearly state what it does. It seems to be only a\n  exporter for certain reports. Anyway, it was archived in 2022, with last commit\n  from 2018.\n\nTo conclude, all projects in this direction seem to be at most prototypes for playing\naround and even those are scarce. The GnuCash dev-team itself doesn't seem to be keen\non providing a real mobile/web alternative, which is perfectly fine and\nunderstandable. I probably wouldn't either if I were them. Luckily, I am not!\n\nLicense\n-------\n\nCopyright © 2023 Joshua Bachmeier \u003cjoshua@bachmeier.cc\u003e\n\nThis program is free software: you can redistribute it and/or modify it under the terms of\nthe GNU General Public License as published by the Free Software Foundation, either\nversion 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but **without any\nwarranty**; without even the implied warranty of **merchantability** or **fitness for a\nparticular purpose**.  See the GNU General Public License for more details.\n\nSee [LICENSE](LICENSE) in this repository or https://www.gnu.org/licenses/ for a copy of\nthe GNU General Public License.\n\nThe contents of the submodules\n[EncryptedSession](https://github.com/SaintFlipper/EncryptedSession) (GPLv3),\n[Selectize](https://github.com/selectize/selectize.js) (Apache License 2.0),\n[Bootstrap](https://github.com/twbs/bootstrap) (MIT License) and\n[GnuCash](https://github.com/Gnucash/gnucash) (mutually-compatible set of licenses) as\nwell as all dependencies are published under their own licenses by their respective authors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuabach%2Fgnucash-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshuabach%2Fgnucash-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuabach%2Fgnucash-web/lists"}