This is a bundle of tools to organize a minimal-cost, trust-based and thus time efficient accounting system for small, self-service community stores.
Members receive individual TagSheets, containing e.g. 96 small stickers with their member id (tags). Each product in the store needs one or several ProductSheets, simple A4 paper sheets with product name, amount and price, as well as a grid of cells to put tags on. To buy a product, a member takes the specified amount of a product and sticks one of his tags on a free cell of the ProductSheet. On day of accounting, all ProductSheets need to be scanned and evaluated. The tools in this repository help automating this process as far as possible, mailing an individual bill to each member and generating csv's which can be processed by GnuCash.
- tagtrail_gen generates empty ProductSheets for products, TagSheets for members
- tagtrail_ocr generates one csv file per product from scanned ProductSheets with tags on it, enumerating all tags in the sheet with ocr_text, recognized tag, confidence
- tagtrail_sanitize interactively leads through ocr-CSVs, lets the user edit all tags (validated against a database of member ids) and thus generates one CSV per product with confidence of all tags = 1
- tagtrail_account
- generates a CSV per member, listing the quantity and price of each product they tagged
- generates transaction CSVs which can be imported by GnuCash, containing two transactions per member (total price of products (net), proft margin on top of this price)
- generates product statistics: how many units of each product should be left, how many were sold during this accounting, ... ?
- prepares for the next accounting period. ProductSheets that are physically removed have to be selected by the user, the CSVs of all remaining products generated by tagtrail_sanitize are copied to a new folder accounted_products
- tagtrail_send compiles and sends an email for each member, with a bill listing the quantity and price of each product they tagged and the total price
- sudo apt install git python3 python3-tk python3-venv python3-dev tesseract-ocr libtesseract-dev libleptonica-dev pkg-config gcc g++ make
- git clone https://github.com/greuters/tagtrail.git
- cd tagtrail
- python3 -m venv tagtrail-env
- source tagtrail-env/bin/activate
- make upgrade
- To verify everything works as expected: make test
- install dependencies (see Ubuntu section for the moment)
- git clone https://github.com/greuters/tagtrail.git
- cd tagtrail
- python3 -m venv tagtrail-env
- source tagtrail-env/bin/activate
- make upgrade
- if tesserocr fails to install because of missing ios, try CFLAGS='-stdlib=libc++' pip install ...
- To verify everything works as expected: make test
- install miniconda with Python 3.8 from https://docs.conda.io/en/latest/miniconda.html
- run Anaconda Prompt, the following commands are entered here
- conda install git
- change to the directory you want to install tagtrail to, e.g. cd C:/Users/Username/AppData/
- git clone https://github.com/greuters/tagtrail.git
- cd tagtrail
- conda install -c conda-forge tesserocr=2.5.2
- pip install -r requirements.txt
- To verify everything works as expected: python -m tests.scenario_medium
- git checkout int
- git fetch origin
- git reset --hard origin/main
- git clean -xdf
- pip install -r requirements.txt
- run tests to verify everything works
- python -m tagtrail.tagtrail_ocr data/next/
- python -m tagtrail.tagtrail_sanitize data/next/
- python -m tagtrail.tagtrail_bankimport data/next/ --accountingDate=2020-04-26
- python -m tagtrail.tagtrail_account data/next/ --accountingDate=2020-04-26
- python -m tagtrail.tagtrail_send data/account_2020-04-26/ 1234 Tester [email protected]
- python -m tagtrail.tagtrail_gen data/next/