|
| 1 | +# RemaTransactionParser |
| 2 | + |
| 3 | +RemaTransactionParser is an utility for converting the JSON files exported by the GDRP data export tool of Rema 1000 (Norwegian grocery store) to more easily digestible formats - Excel 2003+ (XLSX) or a Database Import Script (SQL). |
| 4 | + |
| 5 | +Once the data has been exported to Excel or a Database, it may be further analyzed to calculate the amount spent per product (or a group of products) in any given period. This may be useful for finding ways of reducing your monthly food expenditures (at least in Rema 1000 stores). |
| 6 | + |
| 7 | +# Getting started |
| 8 | +## JSON File |
| 9 | +Due to new GDPR regulations, Rema 1000 has added an automated mechanism for retrieving all the transaction data associated with your user in the "Æ" Customer Loyalty App/Program. Depending on how much you do your grocery shopping in Rema 1000, this may be every grocery shopping trip since 2017, broken into invidual transactions and receipt entries. |
| 10 | + |
| 11 | +To request this data, open the "Æ" app, then click the "profile" button to the right in the bottom menu bar. Then choose _"Vilkår og personvern"_, and click the blue button _"Vis mine data"_ in the resulting window. Click _"Gi meg innsyn i mine data"_, and enter an email address where you want the ZIP-file with the exported data to be sent. |
| 12 | + |
| 13 | +Rema 100 will also send a password by SMS to the same phone number during login in the "Æ" app. This password must be used to decompress the ZIP-file, and extract the containing JSON-file. |
| 14 | + |
| 15 | +## Install |
| 16 | +Before running RemaTransactionParser, first ensure that you have Java 8 or later installed on your system (check by running _java --version_). Download the latest version of Java either from java.com, adoptopenjdk.net or using the package manager of your operating system (if any). |
| 17 | + |
| 18 | +To install RemaTransactionParser, download the latest release from "Releases", and simply extract (or build - see below) RemaTransactionParser to a folder. Optionally, you may add this folder to your PATH variable. Otherwise, always specify RemaTransactionParser by its full file path, or navigate to the folder (_cd_) in the command line. |
| 19 | + |
| 20 | +## Running |
| 21 | +Executing the following command in the command line will convert the JSON-file to an Excel/SQL file. Substitue _source-json_ and _destination-file_ with the corresponding correct file paths: |
| 22 | +```bat |
| 23 | +RemaTransactionParser source-json destination-file |
| 24 | +``` |
| 25 | +The file extension of _destination-file_ specifies the output format - either XLSX or SQL. You may override this behavior by using the -format flag. |
| 26 | + |
| 27 | +## Command Line |
| 28 | +The full documentation of the command line arguments: |
| 29 | +``` |
| 30 | +RemaTransactionParser [-f format] [-s] [-h] source destination |
| 31 | + -f format Specify the output format, either XLSX (Excel 2003) or SQL |
| 32 | + (Database Export script for SQLite). If not specified, the |
| 33 | + output file extension will be used instead. |
| 34 | + -s Enable stream mode, allowing the program to use standard |
| 35 | + output or standard input instead of the file system. Format |
| 36 | + must be specified if no output file is specified. |
| 37 | + -h Show this help text. |
| 38 | + source Path to the JSON-file with the exported Rema 1000 data. |
| 39 | + May be omitted in stream mode. |
| 40 | + destination Path to the output XLSX- or SQL-file where the conversion |
| 41 | + output will be written. May be omitted in stream mode. |
| 42 | +``` |
| 43 | + |
| 44 | +# Building |
| 45 | +The following dependencies must be installed to build RemaTransactionParser: |
| 46 | + - [Java 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) or later |
| 47 | + - [Maven](https://maven.apache.org/) |
| 48 | + |
| 49 | +Then run _mvn package_ in the root RemaTransactionParser folder (with pom.xml). The final shaded JAR file can be found in _target/RemaTransactionParser.jar_. |
| 50 | + |
| 51 | +Script files (.bat or .sh) are stored inside _release/_. |
| 52 | + |
| 53 | +License |
| 54 | +---- |
| 55 | +GPLv2 |
0 commit comments