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.3.tar.gz (69.4 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.3-py3-none-any.whl (93.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rechu-0.0.3.tar.gz
  • Upload date:
  • Size: 69.4 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.3.tar.gz
Algorithm Hash digest
SHA256 2f2c5018205f2dd235a8c1fe269c929e0861e98cf72574d0f6b2edb728f2c9fe
MD5 6c9f152bb5645a1e01b5a8b8cb28e774
BLAKE2b-256 c63006a3da156018b3cf27bc06202ce687801deaa0f0fa0ee21c8872e8c22b9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rechu-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 93.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0364f1472af8f91fa5ad44d67d891d20a742c7182416dcf7f2180d7a3779f3e
MD5 c0a77b0ac664fbc1b739c3a266c25d83
BLAKE2b-256 4b534955445470ed7da78b3222415ff42f2dff9f23bef64d8f8ed2946707c48e

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