Skip to main content

Receipt cataloging hub for detailed personal finance tracking

Project description

Receipt cataloging hub

PyPI PyPI Versions Coverage Coverage Status Quality Gate Status

This repository contains a Python module that implements a database system for reading digitized receipts for detailed product purchases. The receipts, shops and product metadata can be written first in YAML files and imported or they may be created through interactive commands.

The module is written for Python 3.10+ and supported database backends are SQLite and PostgreSQL. It is currently in alpha phase and is meant to be developed with more features for reporting, external data and so on. Detailed information on changes for each version is found in the changelog file. Most recent information on installation, configuration, usage and programming interfaces is found in the documentation.

Installation

To obtain the latest release version of the module and its dependencies from PyPI, use uv add rechu, pip install rechu or poetry add rechu.

Source releases of versions are available from GitHub.

When using the source release or if this repository is cloned, then installation of the module is possible with uv add or pip install followed by one of the following: a wheel, a release zip/tarball or a path to the current directory. make install installs from the current directory. We recommend using virtual environments to keep your dependencies separate from global installation.

To install a development version of the module as a dependency, you can use rechu @ git+https://github.com/lhelwerd/rechu.git@main#egg=rechu in a pyproject.toml project dependencies or similar file.

Running

After installation, the rechu command should be available in your environment to run various subcommands, but it has not been configured and set up with any data sources and database connection.

In order to run the module, first place a settings.toml file in the directory from which you will use the module, which might be the current directory. Either use rechu config > settings.toml or (when using the source release or if this repository is cloned) copy the example rechu/settings.toml file with default values to another settings.toml file, then edit the new file to adjust values in it. If you plan to use this package as a dependency in your own module, then you can also override the values in a pyproject.toml file using [tool.rechu...] sections.

To create the database schema in the database path defined in the settings, use rechu create. Then, you can create receipts and products with rechu new; this command writes the new receipts and product metadata to YAML files in the defined path/filename format and imports them to the database, keeping both in sync. You can also bulk-import YAML files for receipts, shop and product inventories from the defined path, receipt subdirectory pattern, shop path and product pattern with rechu read; you can later use the same command to synchronize changes in YAML files to the database.

When you install a new version of this package, there may be database schema changes which need to be applied to continue using the current model. After backing up your database, you should run rechu alembic upgrade head to migrate your database to the proper version. This command will use the database connection configured in your settings.toml file.

Some additional scripts that do not use the database are available in the scripts directory in the repository. These are mostly meant for experiments, simple reporting and validation.

Development and testing

The module is tested with unit tests that are run on pytest. In the repository, first install dependencies with make setup_test, then run unit tests using make test. Additionally, obtain coverage information by using make coverage to perform the unit tests and receive output in the form of a textual report and XML report. Finally, an HTML report is obtainable with coverage html.

Typing and style checks are also possible by first installing dependencies using make setup_analysis. Then, use make mypy to run the type checker and receive HTML and XML reports. Style checks are done by using make pylint for an aggregate report output.

The unit test coverage, typing coverage, style checks and schema validation is combined in one GitHub Actions workflow which is run on commits to the main branch and pull request changes. Unit test coverage is then stored for comparative purposes via the interface at Coveralls. The tests and coverage results are combined with analysis results (including typing checks and coverage by basedpyright and mypy, code formatting style checks from ruff and pylint and JSON schema validation) as part of a quality gate on SonarCloud.

License

The receipt cataloging hub module is licensed under the MIT License. See the license file for more information.

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

rechu-0.0.2.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rechu-0.0.2-py3-none-any.whl (86.8 kB view details)

Uploaded Python 3

File details

Details for the file rechu-0.0.2.tar.gz.

File metadata

  • Download URL: rechu-0.0.2.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rechu-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7100bdcd9dce2773726a9769d0cbe55045b3abd66c2d48f9109987365539cc41
MD5 a785eecdb9ad99f7df90b5e6373464d4
BLAKE2b-256 d8426ce1499838dc0dc9342e8776b9a8f02e4c89eb318c57c2718879e0400034

See more details on using hashes here.

File details

Details for the file rechu-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rechu-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 86.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rechu-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfa6759934a72681c6dbb75f540c222d779ea564111ce8a94336ebe14da86f48
MD5 855f21d7f2bee3b4ff350c08a7f65f29
BLAKE2b-256 aa4e688e340d051233bbfe8eaef0eb985b3a3bf64fdfcb1494d1bac1bef079ea

See more details on using hashes here.

Supported by

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