https://github.com/leonstoldt/rewe-ebon-evidence-dashboard
Grocery Shopping Analysis Dashboard using Rewe eBon's
https://github.com/leonstoldt/rewe-ebon-evidence-dashboard
ebon evidence rewe
Last synced: about 2 months ago
JSON representation
Grocery Shopping Analysis Dashboard using Rewe eBon's
- Host: GitHub
- URL: https://github.com/leonstoldt/rewe-ebon-evidence-dashboard
- Owner: LeonStoldt
- License: mit
- Created: 2025-01-19T17:39:16.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-04-01T10:52:42.000Z (about 2 months ago)
- Last Synced: 2025-04-01T11:33:51.293Z (about 2 months ago)
- Topics: ebon, evidence, rewe
- Language: JavaScript
- Homepage:
- Size: 293 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# REWE eBon Evidence Dashboard
## How to run
1. Download your eBons (as pdf) into [eBon-folder](./static/ebons)
2. Run `make start` (or equivalent npm commands)## What is it for?
REWE (German food retail company) provides a service called '[eBon](https://www.rewe.de/service/ebon/)', where customers can receive their receipts digitally.
These receipts can be downloaded in the [REWE user portal](https://shop.rewe.de/mydata/meine-einkaeufe/im-markt).
Currently, available formats are `pdf` and `csv`.
While `csv` sounds good for automatic processing, the file looks something like this:
```csv
"Datum","Uhrzeit","Gesamtsumme"
"01.02.2025","18:02:25","37,24"
```Instead, the `pdf` file contains all data and [webD97](https://github.com/webD97) created a javascript library for parsing eBon pdf files into JSON ([rewe-ebon-parser](https://github.com/webD97/rewe-ebon-parser)).
For displaying the data in a dashboard, I went with evidence as it is easy to query data (using sql) and already provides lots of visualizations to analyzing your data.
Additionally, evidence provides a [JavaScript datasource](https://docs.evidence.dev/core-concepts/data-sources/javascript/) which can run arbitrary JavaScript code as a data source.
In order to create an MVP, I went with a small [script](./sources/rewe_ebon_extractor/rewe_ebon_extractor.js) for parsing my eBon pdf files into queryable data.## Long-term solution
In the long run, it makes more sense to query the data directly from the REWE api. First research results are:1. Rewe Login token might be received via `curl 'https://account.rewe.de/realms/sso/login-actions/authenticate' --data-raw 'username=test%40test.de&password=test&rememberMe=on'`
2. `https://shop.rewe.de/api/receipts/` shows all receipts as overview with RSTP token (example which uses api: https://github.com/Craze1997/grocy-rewe-connect/blob/main/main.py)
3. `https://shop.rewe.de/api/receipts/` shows complete receipt
4. a custom evidence datasource provider can be written including parameter handling for REWE login## Related
- [Rewe eBon parser library](https://github.com/webD97/rewe-ebon-parser)
- [Grocy Rewe Connect](https://github.com/Craze1997/grocy-rewe-connect)
- [Evidence Home Page](https://www.evidence.dev)
- [Evidence Docs](https://docs.evidence.dev)
- [DuckDB Docs](https://duckdb.org/docs)
- [DuckDB JSON Functions](https://duckdb.org/docs/data/json/json_functions.html)